File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -116,6 +116,18 @@ module.exports = function (classes) {
116116 */
117117 handleHttp : function ( req , res ) {
118118 var buffer = '' , self = this ;
119+ var headers ;
120+
121+ if ( req . method === 'OPTIONS' ) {
122+ headers = {
123+ 'Content-Length' : 0 ,
124+ 'Access-Control-Allow-Headers' : 'Accept, Authorization, Content-Type'
125+ } ;
126+ headers = extend ( self . opts . headers , headers ) ;
127+ res . writeHead ( 200 , headers ) ;
128+ res . end ( ) ;
129+ return ;
130+ }
119131
120132 if ( ! self . _checkAuth ( req , res ) ) {
121133 return ;
@@ -148,7 +160,8 @@ module.exports = function (classes) {
148160 }
149161
150162 var reply = function reply ( json ) {
151- var encoded , headers = {
163+ var encoded ;
164+ headers = {
152165 'Content-Type' : 'application/json'
153166 } ;
154167
You can’t perform that action at this time.
0 commit comments