Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid waiting for a WWW-Authenticate under HTTP Basic auth #147

Conversation

leosoto
Copy link
Contributor

@leosoto leosoto commented Feb 13, 2014

HTTPClient doesn't send any credentials unless it has seen a previous
challenge for the requested URL in the form of a WWW-Authenticate
header. Such challenge is sent by the server after it receives an
unauthenticated request to such URL. The wasted roundtrip wouldn't
be too bad if it were limited to the first request. However,
httpclient only remembers the challenge for each individual URL and
their 'child' URLs. This means that, for example, HTTP requests to
/db/data/node/ will probably incur in a new wasteful rountrip
for each different value of .

The fix makes httpclient think that it has received a challenge
for the root URL of the neo4j server.

HTTPClient doesn't send any credentials unless it has seen a previous
challenge for the requested URL in the form of a WWW-Authenticate
header. Such challenge is sent by the server after it receives an
unauthenticated request to such URL. The wasted roundtrip wouldn't
be too bad if it were limited to the first request. However,
httpclient only remembers the challenge for each individual URL and
their 'child' URLs. This means that, for example, HTTP requests to
/db/data/node/<X> will probably incur in a new wasteful rountrip
for each different value of <X>.

The fix makes httpclient think that it has received a challenge
for the root URL of the neo4j server.
@leosoto
Copy link
Contributor Author

leosoto commented Feb 13, 2014

This should fix #128

maxdemarzi added a commit that referenced this pull request Feb 13, 2014
…or-basic-auth

Avoid waiting for a WWW-Authenticate under HTTP Basic auth
@maxdemarzi maxdemarzi merged commit 715ef13 into maxdemarzi:master Feb 13, 2014
@maxdemarzi
Copy link
Owner

Great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants