Skip to content

Commit 0d1b78a

Browse files
Merge branch 'v2' into store-rework-2
2 parents 99cafa6 + cfd48b3 commit 0d1b78a

File tree

4 files changed

+66
-52
lines changed

4 files changed

+66
-52
lines changed

.changes/http-allow-skip-origin.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"http": "patch"
3+
"http-js": "patch"
4+
---
5+
6+
Allow skipping sending `Origin` header in HTTP requests by setting `Origin` header to an empty string when calling `fetch`.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"rollup": "4.22.4",
2424
"tslib": "2.7.0",
2525
"typescript": "5.6.3",
26-
"typescript-eslint": "8.8.1"
26+
"typescript-eslint": "8.9.0"
2727
},
2828
"resolutions": {
2929
"semver": ">=7.5.2",

plugins/http/src/commands.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,14 @@ pub async fn fetch<R: Runtime>(
264264
}
265265
}
266266

267+
// In case empty origin is passed, remove it. Some services do not like Origin header
268+
// so this way we can remove it in explicit way. The default behaviour is still to set it
269+
if cfg!(feature = "unsafe-headers")
270+
&& headers.get(header::ORIGIN) == Some(&HeaderValue::from_static(""))
271+
{
272+
headers.remove(header::ORIGIN);
273+
};
274+
267275
if let Some(data) = data {
268276
request = request.body(data);
269277
}

pnpm-lock.yaml

Lines changed: 51 additions & 51 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)