File tree 2 files changed +2
-8
lines changed
2 files changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,8 @@ module.exports = function(options) {
58
58
// https://github.com/rs/cors/issues/10
59
59
ctx . vary ( 'Origin' ) ;
60
60
61
+ if ( ! requestOrigin ) return await next ( ) ;
62
+
61
63
let origin ;
62
64
if ( typeof options . origin === 'function' ) {
63
65
origin = await options . origin ( ctx ) ;
Original file line number Diff line number Diff line change @@ -77,14 +77,6 @@ describe('cors.test.js', function() {
77
77
. expect ( { foo : 'bar' } )
78
78
. expect ( 200 , done ) ;
79
79
} ) ;
80
-
81
- it ( 'should always set `Access-Control-Allow-Origin` to *, even if no Origin is passed on request' , function ( done ) {
82
- request ( app . listen ( ) )
83
- . get ( '/' )
84
- . expect ( 'Access-Control-Allow-Origin' , '*' )
85
- . expect ( { foo : 'bar' } )
86
- . expect ( 200 , done ) ;
87
- } ) ;
88
80
} ) ;
89
81
90
82
describe ( 'options.secureContext=true' , function ( ) {
You can’t perform that action at this time.
0 commit comments