spray/spray — pull request #745 by markdrago (2014-01-01 13:45:09+00:00)
Title: can: allow sending a raw query within a URL via Raw-Request-URI header

This should fix issue #654 by adding support for Raw-Request-URI on the client-side. When rending the request it looks to see if a Raw-Request-URI header is present and if it is it renders its value instead of the URI. This allows the caller to specify any String as the URI and avoid any decoding/encoding that spray would otherwise perform.

Currently this will not render the Raw-Request-URI header when rendering the headers. Instead it logs a warning which says that the Raw-Request-URI header is used to override the URI and is not sent in the headers. It seems odd to send this header out as a header as it exposes a bit of the spray API and the caller would have no way of sending a raw URI and not sending this header along. It also seems weird to log a warning when a supported feature is used, but IMO that is better than not providing any feedback when deciding to not render a header.

This doesn't change anything related to how the Host header is determined. It is still pulled from the regular URI (or an explicitly specified Host header) in the request-level API. This seems right although it could lead to some odd situations where the host in a Host header and the host in an absolute URI in the request line differ. IMO this is reasonable behavior when using Raw-Request-URI.