Skip to content

Commit

Permalink
Merge pull request #176 from namecheap/feature/auth_header_forwarding
Browse files Browse the repository at this point in the history
feat: now micro-frontends will receive "Authorization" http header
  • Loading branch information
StyleT authored Jun 12, 2020
2 parents a6f9bc6 + cc1e6b4 commit 1c2615f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions ilc/server/tailor/filter-headers.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use strict';
const ACCEPT_HEADERS = [
'authorization',
'accept-language',
'referer',
'user-agent',
Expand Down
2 changes: 2 additions & 0 deletions ilc/server/tailor/filter-headers.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ describe('filter headers', () => {

const request = {
headers: {
'authorization': 'Bearer 12345',
'content-type': 'text/html',
'host': 'www.somewhere.com/host',
'accept-language': 'fr-CH, fr;q=0.9, en;q=0.8, de;q=0.7, *;q=0.5',
Expand All @@ -54,6 +55,7 @@ describe('filter headers', () => {
};

chai.expect(filterHeaders(attributes, request)).to.be.eql({
'authorization': 'Bearer 12345',
'accept-language': request.headers['accept-language'],
'referer': request.headers['referer'],
'user-agent': request.headers['user-agent'],
Expand Down

0 comments on commit 1c2615f

Please sign in to comment.