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

1.45.3 breaks fetch with user:pass in URL #24697

Closed
albnnc opened this issue Jul 24, 2024 · 2 comments · Fixed by #24705
Closed

1.45.3 breaks fetch with user:pass in URL #24697

albnnc opened this issue Jul 24, 2024 · 2 comments · Fixed by #24705
Assignees
Labels
bug Something isn't working correctly

Comments

@albnnc
Copy link
Contributor

albnnc commented Jul 24, 2024

Version: Deno 1.45.3

Found out that our tests which are using "http://user:pass@localhost..." connection strings broke with auth-related errors after 1.45.2–>1.45.3 upgrade.

To be specific, broken tests use docker.io/clickhouse/clickhouse-server:23.7.1-alpine.

@bartlomieju bartlomieju added the bug Something isn't working correctly label Jul 24, 2024
@bartlomieju bartlomieju self-assigned this Jul 24, 2024
@bartlomieju
Copy link
Member

Do you have proxies involved? Are you using fetch() API? Is there any code you could share?

@albnnc
Copy link
Contributor Author

albnnc commented Jul 24, 2024

Test code
Deno.serve({ port: 10_000 }, (req) => {
  console.log("req.url", req.url);
  console.log("req.headers", Array.from(req.headers));
  return new Response(null);
});

fetch("http://root:root@localhost:10000");
1.45.2
Listening on http://localhost:10000/
req.url http://localhost:10000/
req.headers [
  [ "accept", "*/*" ],
  [ "accept-encoding", "gzip, br" ],
  [ "accept-language", "*" ],
  [ "authorization", "Basic cm9vdDpyb290" ],
  [ "host", "localhost:10000" ],
  [ "user-agent", "Deno/1.45.2" ]
]
1.45.3
Listening on http://localhost:10000/
req.url http://localhost:10000/
req.headers [
  [ "accept", "*/*" ],
  [ "accept-encoding", "gzip,br" ],
  [ "accept-language", "*" ],
  [ "host", "localhost:10000" ],
  [ "user-agent", "Deno/1.45.3" ]
]

Looks like "authorization" header is missing on 1.45.3.

dsherret pushed a commit that referenced this issue Jul 26, 2024
This commit fixes handling of "authority" in the URL by properly
sending "Authorization Basic..." header in `fetch` API.

This is a regression from #24593
Fixes #24697

CC @seanmonstar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants