Azard / egg-oauth2-server

:star2: OAuth2 server plugin for egg.js based on node-oauth2-server
MIT License
179 stars 45 forks source link

replaceResponse #34

Closed sm2017 closed 5 years ago

sm2017 commented 5 years ago

What replaceResponse do exactly? https://github.com/Azard/egg-oauth2-server/blob/master/lib/server.js#L15-L31

Why we cannot do simply const response = new Response(ctx.response); instead of const response = new Response(replaceResponse(ctx.response)); ?

Azard commented 5 years ago

As the comment say

// copy for response.headers.hasOwnProperty is undefined case
// https://github.com/oauthjs/node-oauth2-server/pull/486