Skip to content

Commit

Permalink
fix: expose only supported cors methods
Browse files Browse the repository at this point in the history
  • Loading branch information
panva committed Feb 20, 2019
1 parent d642f8b commit 4a81104
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/helpers/initialize_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ module.exports = function initializeApp() {
};

const { routes } = configuration;
const onlyGetCors = getCors({ allowedMethods: 'GET' });
const onlyGetCors = getCors({ allowMethods: 'GET' });

Object.entries(grants).forEach(([grantType, { handler, parameters }]) => {
const { grantTypeHandlers } = instance(this);
Expand Down Expand Up @@ -142,7 +142,7 @@ module.exports = function initializeApp() {

const userinfo = getUserinfo(this);
const userInfoCors = getCors({
allowedMethods: 'GET,POST', exposeHeaders: 'WWW-Authenticate', allowHeaders: 'Authorization',
allowMethods: 'GET,POST', exposeHeaders: 'WWW-Authenticate', allowHeaders: 'Authorization',
});
get('userinfo', routes.userinfo, userInfoCors, error(this, 'userinfo.error'), ...userinfo);
post('userinfo', routes.userinfo, userInfoCors, error(this, 'userinfo.error'), ...userinfo);
Expand Down

0 comments on commit 4a81104

Please sign in to comment.