Skip to content

Commit

Permalink
Merge pull request #2162 from Hyperkid123/content-length-issues
Browse files Browse the repository at this point in the history
fix(proxy): deflate gziped responses
  • Loading branch information
Hyperkid123 authored Jan 28, 2025
2 parents 174ffcd + a4b9409 commit bf54487
Show file tree
Hide file tree
Showing 15 changed files with 43 additions and 29 deletions.
3 changes: 2 additions & 1 deletion packages/advisor-components/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@
"options": {
"push": true,
"preset": "conventionalcommits",
"commitMessageFormat": "chore: bump {projectName} to {version} [skip ci]"
"commitMessageFormat": "chore: bump {projectName} to {version} [skip ci]",
"trackDeps": true
},
"dependsOn": ["^version"]
},
Expand Down
3 changes: 2 additions & 1 deletion packages/chrome/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@
"options": {
"push": true,
"preset": "conventionalcommits",
"commitMessageFormat": "chore: bump {projectName} to {version} [skip ci]"
"commitMessageFormat": "chore: bump {projectName} to {version} [skip ci]",
"trackDeps": true
},
"dependsOn": ["^version"]
},
Expand Down
3 changes: 2 additions & 1 deletion packages/components/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@
"options": {
"push": true,
"preset": "conventionalcommits",
"commitMessageFormat": "chore: bump {projectName} to {version} [skip ci]"
"commitMessageFormat": "chore: bump {projectName} to {version} [skip ci]",
"trackDeps": true
},
"dependsOn": ["^version"]
},
Expand Down
3 changes: 2 additions & 1 deletion packages/config-utils/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"options": {
"push": true,
"preset": "conventionalcommits",
"commitMessageFormat": "chore: bump {projectName} to {version} [skip ci]"
"commitMessageFormat": "chore: bump {projectName} to {version} [skip ci]",
"trackDeps": true
},
"dependsOn": ["^version"]
},
Expand Down
30 changes: 15 additions & 15 deletions packages/config-utils/src/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,12 +234,6 @@ const proxy = ({
secure: false,
changeOrigin: true,
autoRewrite: true,
onProxyReq: (proxyReq, req) => {
if (isInterceptAbleRequest(req.url)) {
// necessary to avoid gzip encoding and issues with parsing the json body
proxyReq.setHeader('accept-encoding', 'gzip;q=0,deflate,sdch');
}
},
onProxyRes: (proxyRes, req, res) => {
// this should reading the aggregated bundles filed generated from chrome service
// The functionality is disabled until the interceptor is ready
Expand Down Expand Up @@ -319,15 +313,21 @@ const proxy = ({

return null;
},
...(agent && {
agent,
headers: {
// Staging Akamai CORS gives 403s for non-GET requests from non-origin hosts
Host: target.replace('https://', ''),
// Origin format is protocol://hostname:port only, remove any trailing slash
Origin: target.replace(/\/$/, ''),
},
}),
...(agent
? {
agent,
headers: {
// Set FEO gzip headers here to prevent issues with setting headers after response was closed
'accept-encoding': 'gzip;q=0,deflate,sdch',
// Staging Akamai CORS gives 403s for non-GET requests from non-origin hosts
Host: target.replace('https://', ''),
// Origin format is protocol://hostname:port only, remove any trailing slash
Origin: target.replace(/\/$/, ''),
},
}
: {
'accept-encoding': 'gzip;q=0,deflate,sdch',
}),
});
}

Expand Down
3 changes: 2 additions & 1 deletion packages/config/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
"options": {
"push": true,
"preset": "conventionalcommits",
"commitMessageFormat": "chore: bump {projectName} to {version} [skip ci]"
"commitMessageFormat": "chore: bump {projectName} to {version} [skip ci]",
"trackDeps": true
},
"dependsOn": ["^version"]
},
Expand Down
3 changes: 2 additions & 1 deletion packages/eslint-config/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"options": {
"push": true,
"preset": "conventionalcommits",
"commitMessageFormat": "chore: bump {projectName} to {version} [skip ci]"
"commitMessageFormat": "chore: bump {projectName} to {version} [skip ci]",
"trackDeps": true
},
"dependsOn": ["^version"]
},
Expand Down
3 changes: 2 additions & 1 deletion packages/notifications/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@
"options": {
"push": true,
"preset": "conventionalcommits",
"commitMessageFormat": "chore: bump {projectName} to {version} [skip ci]"
"commitMessageFormat": "chore: bump {projectName} to {version} [skip ci]",
"trackDeps": true
},
"dependsOn": ["^version"]
},
Expand Down
3 changes: 2 additions & 1 deletion packages/remediations/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@
"options": {
"push": true,
"preset": "conventionalcommits",
"commitMessageFormat": "chore: bump {projectName} to {version} [skip ci]"
"commitMessageFormat": "chore: bump {projectName} to {version} [skip ci]",
"trackDeps": true
},
"dependsOn": ["^version"]
},
Expand Down
3 changes: 2 additions & 1 deletion packages/rule-components/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@
"options": {
"push": true,
"preset": "conventionalcommits",
"commitMessageFormat": "chore: bump {projectName} to {version} [skip ci]"
"commitMessageFormat": "chore: bump {projectName} to {version} [skip ci]",
"trackDeps": true
},
"dependsOn": ["^version"]
},
Expand Down
3 changes: 2 additions & 1 deletion packages/testing/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@
"options": {
"push": true,
"preset": "conventionalcommits",
"commitMessageFormat": "chore: bump {projectName} to {version} [skip ci]"
"commitMessageFormat": "chore: bump {projectName} to {version} [skip ci]",
"trackDeps": true
},
"dependsOn": ["^version"]
},
Expand Down
3 changes: 2 additions & 1 deletion packages/translations/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@
"options": {
"push": true,
"preset": "conventionalcommits",
"commitMessageFormat": "chore: bump {projectName} to {version} [skip ci]"
"commitMessageFormat": "chore: bump {projectName} to {version} [skip ci]",
"trackDeps": true
},
"dependsOn": ["^version"]
},
Expand Down
3 changes: 2 additions & 1 deletion packages/tsc-transform-imports/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"options": {
"push": true,
"preset": "conventionalcommits",
"commitMessageFormat": "chore: bump {projectName} to {version} [skip ci]"
"commitMessageFormat": "chore: bump {projectName} to {version} [skip ci]",
"trackDeps": true
},
"dependsOn": ["^version"]
},
Expand Down
3 changes: 2 additions & 1 deletion packages/types/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"options": {
"push": true,
"preset": "conventionalcommits",
"commitMessageFormat": "chore: bump {projectName} to {version} [skip ci]"
"commitMessageFormat": "chore: bump {projectName} to {version} [skip ci]",
"trackDeps": true
},
"dependsOn": ["^version"]
},
Expand Down
3 changes: 2 additions & 1 deletion packages/utils/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@
"options": {
"push": true,
"preset": "conventionalcommits",
"commitMessageFormat": "chore: bump {projectName} to {version} [skip ci]"
"commitMessageFormat": "chore: bump {projectName} to {version} [skip ci]",
"trackDeps": true
},
"dependsOn": ["^version"]
},
Expand Down

0 comments on commit bf54487

Please sign in to comment.