Where to absolutize response's location headers

105 views
Skip to first unread message

Kevin Esler

unread,
Mar 27, 2013, 3:34:48 PM3/27/13
to spray...@googlegroups.com
I need to convert responses' location header values from relative to absolute somewhere in my Spray service. Any recommendations as to the best place to get this done?

Mathias

unread,
Mar 28, 2013, 5:19:29 AM3/28/13
to spray...@googlegroups.com
Kevin,

actually this is something that spray should be able to do itself.
I've just added ticket for this: https://github.com/spray/spray/issues/254

The latest nightlies come with a completely new URI model (much improved over what we had with M7), which already supports URI resolution as defined by RFC 3986 (http://tools.ietf.org/html/rfc3986#section-5.2). With M7 you'll have to write you own resolution logic (which is not hard).

Until spray supports Location header resolution itself you are probably best off with a small custom directive that wraps the relevant parts of your route structure and relies on `mapRequest` to change an potentially existing Location header to its resolved counterpart.

HTH and cheers,
Mathias

---
mat...@spray.io
http://spray.io
> --
> You received this message because you are subscribed to the Google Groups "spray-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to spray-user+...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Kevin Esler

unread,
Mar 28, 2013, 9:38:59 AM3/28/13
to spray...@googlegroups.com
Wow thanks. Great news. I have something that works now but something built in to Spray would be very nice.
Reply all
Reply to author
Forward
0 new messages