Skip to content

Commit

Permalink
fix: Remove Authorization if token undefined
Browse files Browse the repository at this point in the history
Signed-off-by: leoliu <leoliu@yunify.com>
  • Loading branch information
leoliu committed Aug 3, 2020
1 parent 03752d1 commit 54a3f80
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion server/proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ const k8sResourceProxy = {
events: {
proxyReq(proxyReq, req) {
// Set authorization
proxyReq.setHeader('Authorization', `Bearer ${req.token}`)
if (req.token) {
proxyReq.setHeader('Authorization', `Bearer ${req.token}`)
}

NEED_OMIT_HEADERS.forEach(key => proxyReq.removeHeader(key))
},
Expand Down

0 comments on commit 54a3f80

Please sign in to comment.