Add http auth header on :GET, :POST etc requests when appropriate #559
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Info
If a requested url matches any of these criterias, the
Authorization
header will be added to requests from the commands:GET
,:POST
etc.:GET /db/data
):GET http://localhost:7474/db/data/
from a browser host onhttp://localhost:7474
):GET http://localhost:7474/db/data/
from a browser which is connected to Neo4j onbolt://localhost:7687
)(the reason we need (2) above is because the bolt host can be different from the host where the browser is served from even though it's the same machine)
Manual test cases
Open the web browsers dev tools, network tab.
:GET /hello
- Should include authorization header.:GET http://localhost:7474/db/data/
(note trailing slash) - if request when connected to localhost over bolt: should include an authorization header. Response should be available.:GET http://127.0.01:7474/db/data/
- should fail with error code 401 because no auth header present.:GET https://oskarhane-dropshare-eu.s3-eu-central-1.amazonaws.com/conf2-SX8pcCviMC/conf2.json
should not include an authorization header. Response should be available.changelog: Fix missing auth headers on local
:GET
,:POST
etc command requests