Skip to content

Commit

Permalink
fix: proxy bypass issue
Browse files Browse the repository at this point in the history
  • Loading branch information
HenryT-CG committed Aug 11, 2024
1 parent fae5cf3 commit 3ca11ec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions proxy.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
const logFn = function (req, res) {
//console.log(new Date().toISOString() + `: bypassing ${req.method} ${req.url} `)
}
const bypassFn = function (req, res) {
function onProxyRes(proxyRes, req, res) {
logFn(req, res)
if (req.method.toUpperCase() === 'OPTIONS') {
res.setHeader('Allow', 'GET, POST, HEAD, PUT, DELETE, OPTIONS')
Expand All @@ -25,7 +25,7 @@ const PROXY_CONFIG = {
},
changeOrigin: true,
logLevel: 'debug',
bypass: bypassFn
onProxyRes: onProxyRes
}
}

Expand Down

0 comments on commit 3ca11ec

Please sign in to comment.