Skip to content

Commit ba963af

Browse files
committed
Fix forwarding the content-length header which was screwing up HTTP2 requests in Chrome
1 parent 5317826 commit ba963af

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ When you need a file, but the headers ain't good, who you gonna call? CORS Buste
33

44
## What is this?
55

6-
This is the software running on https://cors-buster.now.sh, a free
6+
This is the software running on https://cors-buster-tbgktfqyku.now.sh, a free
77
service for AJAX users struggling to work around the fact that many websites
88
do not implement CORS headers, even for static content.
99

@@ -21,7 +21,7 @@ Uncaught (in promise) TypeError: Failed to fetch
2121
You can do this instead, and now there's no error:
2222

2323
```
24-
window.fetch('http://cors-buster.now.sh/nodejs.org/dist/v6.10.2/node-v6.10.2-linux-x64.tar.gz')
24+
window.fetch('https://cors-buster-tbgktfqyku.now.sh/nodejs.org/dist/v6.10.2/node-v6.10.2-linux-x64.tar.gz')
2525
```
2626

2727
## Is this safe?

index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ async function service (req, res) {
106106
}
107107
)
108108
for (let h of exposeHeaders) {
109+
if (h === 'content-length') continue
109110
if (f.headers.has(h)) {
110111
res.setHeader(h, f.headers.get(h))
111112
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cors-buster",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"description": "When you need a file, but the headers ain't good, who you gonna call? CORS Buster!",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)