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

client: set authorization header from the URL #1384

Merged
merged 4 commits into from
May 31, 2024
Merged

client: set authorization header from the URL #1384

merged 4 commits into from
May 31, 2024

Conversation

niklasad1
Copy link
Member

@niklasad1 niklasad1 commented May 30, 2024

Close #1371

The rationale is to unify the behavior how cuRL, browsers and similar are handling username and passwords from URLs.

Testing

curl

$ curl -sSG "http://user:pwd@localhost:9944"
2024-05-31 09:25:59.366 TRACE tokio-runtime-worker jsonrpsee-server: Request { method: GET, uri: /, version: HTTP/1.1, headers: {"host": "localhost:9944", "authorization": "Basic dXNlcjpwd2Q=", "user-agent": "curl/8.2.1", "accept": "*/*"}, body: Body(UnsyncBoxBody) }

jsonrpsee ws client

$ jsonrpsee-ws
2024-05-31 09:28:32.016 TRACE tokio-runtime-worker jsonrpsee-server: Request { method: GET, uri: /, version: HTTP/1.1, headers: {"host": "localhost:9944", "upgrade": "websocket", "connection": "Upgrade", "sec-websocket-key": "amixRuJIg8sPqd0K2tNSTw==", "authorization": "Basic dXNlcjpwd2Q=", "sec-websocket-version": "13"}, body: Body(UnsyncBoxBody) }

jsonrpsee http client

$ jsonrpsee-http 
2024-05-31 09:39:21.580 TRACE tokio-runtime-worker jsonrpsee-server: Request { method: POST, uri: /, version: HTTP/1.1, headers: {"content-type": "application/json", "accept": "application/json", "authorization": "Basic dXNlcjpwd2Q=", "host": "localhost:9944", "content-length": "62"}, body: Body(UnsyncBoxBody) }

@niklasad1 niklasad1 requested a review from a team as a code owner May 30, 2024 17:57
@niklasad1 niklasad1 changed the title client: set basic auth based on the URL client: set authorization header from the URL May 31, 2024
@niklasad1 niklasad1 merged commit a3307b8 into master May 31, 2024
11 checks passed
@niklasad1 niklasad1 deleted the na-fix-1371 branch May 31, 2024 14:32
@niklasad1 niklasad1 mentioned this pull request Jun 6, 2024
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.

Username and password in the url ignored
2 participants