-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: support Koa2 / Node 6.2 #20
Conversation
Current coverage is 98.11%@@ v2.x #20 diff @@
==========================================
Files 1 1
Lines 53 53
Methods 3 3
Messages 0 0
Branches 19 20 +1
==========================================
- Hits 53 52 -1
- Misses 0 1 +1
Partials 0 0
|
@leecade ci test fail |
@@ -51,7 +51,7 @@ module.exports = function(options) { | |||
return function cors(ctx, next) { | |||
// If the Origin header is not present terminate this set of steps. | |||
// The request is outside the scope of this specification. | |||
const requestOrigin = ctx.get('Origin'); | |||
const requestOrigin = ctx.get('Origin') || ctx.origin; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add a test case for this fix?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ctx.origin points to the url to which the client connects to not the origin header right? Is this fix correct?
can this be rebased and merged? |
What's the status of this? @fengmk2 |
@leecade should rebase and add a test case for this change. |
I think this PR can be closed since Node 6 support was just dropped since 3.0.0. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @luisfarzati, should close this.
close for now, seems it is not a fix for this problem. :( |
fixes #18