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

fix(fetch): fallback to default UA and CA data for Deno.createHttpClient() #9830

Merged
merged 4 commits into from
Mar 18, 2021

Conversation

AaronO
Copy link
Contributor

@AaronO AaronO commented Mar 18, 2021

Fixes #9827

Correct behaviour after fix

 cat <<EOF | ./target/debug/deno run -A --unstable -
const client = Deno.createHttpClient({});
const response = await fetch(
    "https://dump-headers.herokuapp.com/",
    { client },
);
const data = await response.json();
console.log(data["user-agent"]);
EOF
Deno/1.8.1

Also use a single create_http_client implementation (removing runtime::http_util)

Fixes denoland#9827
@AaronO AaronO changed the title Fix Deno.createHttpClient(): fallback to default UA and CA data fix(fetch): fallback to default UA and CA data for Deno.createHttpClient() Mar 18, 2021
@AaronO
Copy link
Contributor Author

AaronO commented Mar 18, 2021

@lucacasonato Added a regression test: c07c2d0

@AaronO AaronO mentioned this pull request Mar 18, 2021
24 tasks
Copy link
Member

@lucacasonato lucacasonato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for the fix.

@lucacasonato lucacasonato merged commit 7d12dd1 into denoland:main Mar 18, 2021
@AaronO AaronO deleted the fix/9827 branch March 18, 2021 22:54
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.

Deno.createHttpClient() leaves User-Agent undefined
2 participants