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

feat: Deno.createHttpClient allowHost #19689

Merged
merged 7 commits into from
Jul 28, 2023

Conversation

crowlKats
Copy link
Member

@crowlKats crowlKats commented Jul 3, 2023

This adds an option to allow using the host header in a fetch call.
Closes #16840
Ref #11017

@andreubotella
Copy link
Contributor

You should also test that the header is sent, not just that it's exposed in the Headers object.

ext/fetch/26_fetch.js Outdated Show resolved Hide resolved
Copy link
Collaborator

@aapoalas aapoalas left a comment

Choose a reason for hiding this comment

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

Lint.

@@ -237,11 +237,11 @@ pub fn op_fetch<FP>(
where
FP: FetchPermissions + 'static,
{
let client = if let Some(rid) = client_rid {
let (client, allow_host) = if let Some(rid) = client_rid {
Copy link
Collaborator

Choose a reason for hiding this comment

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

comment: This is the first time I see this sort of combination of let and if let Some(X) = Y. I am both in awe and appalled :D But, it makes sense after a while and was here before we got here so of course why not.

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.

Great. LGTM

@bartlomieju bartlomieju added this to the 1.36 milestone Jul 23, 2023
@bartlomieju bartlomieju enabled auto-merge (squash) July 28, 2023 06:09
@bartlomieju bartlomieju merged commit 5cb1d18 into denoland:main Jul 28, 2023
10 checks passed
@crowlKats crowlKats deleted the httpclient_allowhost branch July 28, 2023 07:40
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.

Fetch allow modifying Host header
5 participants