-
Notifications
You must be signed in to change notification settings - Fork 772
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: ensure that Origin header is rewritten as necessary (#4812)
* fix: ensure that Origin header is rewritten as necessary The `wrangler dev` command puts the Worker under test behind a proxy server. This proxy server should be transparent to the client and the Worker, which means that the `Request` arriving at the Worker with the correct `url` property, and `Host` and `Origin` headers. Previously we fixed the `Host` header but missed the `Origin` header which is only added to a request under certain circumstances, such as cross-origin requests. This change fixes the `Origin` header as well, so that it is rewritten, when it exists, to use the `origin` of the `url` property. Fixes #4761 * test: ensure that temp dirs used in tests do not collide
- Loading branch information
1 parent
e3a5761
commit 8166eef
Showing
6 changed files
with
78 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
"miniflare": patch | ||
--- | ||
|
||
fix: ensure that Origin header is rewritten as necessary | ||
|
||
The `wrangler dev` command puts the Worker under test behind a proxy server. | ||
This proxy server should be transparent to the client and the Worker, which | ||
means that the `Request` arriving at the Worker with the correct `url` property, | ||
and `Host` and `Origin` headers. | ||
Previously we fixed the `Host` header but missed the `Origin` header which is | ||
only added to a request under certain circumstances, such as cross-origin requests. | ||
|
||
This change fixes the `Origin` header as well, so that it is rewritten, when it exists, | ||
to use the `origin` of the `url` property. | ||
|
||
Fixes #4761 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters