hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Leigh (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HTTPCLIENT-1351) Fragments Are Lost When Following Redirects
Date Mon, 27 May 2013 14:00:23 GMT

    [ https://issues.apache.org/jira/browse/HTTPCLIENT-1351?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13667758#comment-13667758
] 

James Leigh commented on HTTPCLIENT-1351:
-----------------------------------------

The HTTPbis Working Group has *clarified* the semantics of the HTTP/1.1 Location response
header[1] (since RFC2616 was first published in 1999) and HTTP/1.1 now clearly states fragment
identifiers maybe part of the Location header value and now references RFC 3986[2] (published
in 2005), which explains that fragment identifiers are preserved during reference resolution.

I think the concept of "location" is tricky for people not familiar with HTTP/1.1, having
a "getHttpLocation()" method will make it easier for httpclient users to use the correct value.

I think a good HTTP library SHOULD implement as much of HTTP as reasonably possible. This
includes both explicit (over the wire) and derived terms. The architecture of HttpClient 4.2
did not allow for derived terms, however, HttpClient 4.3 allows such terms to be encapsulated
within the context and derived as needed. I think the final interpreted location SHOULD be
part of the HttpClient framework.

"Does it really need to be a part of the framework?" -- that is up to you; "need" is a fairly
strong term. I do not need this in httpclient to comply with HTTP/1.1, but if it was, it would
certainly make it easier for others to also comply with HTTP/1.1.

[1] http://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-22#section-7.1.2
[2] http://tools.ietf.org/html/rfc3986#section-5

James
                
> Fragments Are Lost When Following Redirects
> -------------------------------------------
>
>                 Key: HTTPCLIENT-1351
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1351
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: HttpClient
>    Affects Versions: 4.2.5, 4.3 Beta1
>            Reporter: James Leigh
>            Priority: Minor
>             Fix For: 4.3 Beta2
>
>         Attachments: HTTP_LOCATION.patch, interpreted-location.patch, redirect-locations.patch
>
>
> The current HTTP draft says that when following a redirect with a fragment identifier,
it should be processed. However, when HttpClient is set to following redirect there is no
way to recover the last fragment identifier.
>     Location = URI-reference
> http://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-22#section-7.1.2
> I suggest adding a localContext attribute that contains the last fragment identifiers
as is done with the last host and last request. The relevant code is in org.apache.http.impl.client.DefaultRedirectStrategy.
> Relevant document includes:
> http://hc.apache.org/httpcomponents-client-ga/tutorial/html/httpagent.html#d5e1225
> This issue maybe related to https://issues.apache.org/jira/browse/HTTPCLIENT-1286

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Mime
View raw message