[Twisted-web] return the full (absolute) request URI
exarkun at divmod.com
Tue Jan 15 16:15:49 EST 2008
On Tue, 15 Jan 2008 12:33:47 -0800, David Reid <dreid at dreid.org> wrote:
>On Jan 15, 2008, at 6:44 AM, Manlio Perillo wrote:
>>Christopher Armstrong ha scritto:
>>>On Jan 15, 2008 9:24 AM, Manlio Perillo <manlio_perillo at libero.it> wrote:
>>>>I need to do a redirect to the same URI the client requested, however it
>>>>seems that Twisted Web has no support for this.
>>>>request.prePathURL() is an absolute URI, but is not good and request.uri
>>>>is not an absolute URI
>>>>(an absolute URI is required in the Location header
>>>Just to clarify:
>>>The URI that the client requested is only the path; they do not give a
>>>full absolute URI on the "GET" (or "POST", or whatever method) line.
>>Well, according to the HTTP protocol specification, a client *can* send an
>>Request-URI = "*" | absoluteURI | abs_path | authority
>This is only for proxies.
I think the RFC states that servers, even non-proxy servers, SHOULD accept
absoluteURIs for Request-URI, even though no client will send them in the
non-proxy case. In anticipation of HTTP/1.2 or something. Dunno if this
has any practical consequences, probably not.
More information about the Twisted-web