pronebel / think-cors

[已过期]thinkjs-Middleware-cors
MIT License
12 stars 2 forks source link

options不会被阻断 #2

Closed l-t-yuan closed 7 years ago

l-t-yuan commented 7 years ago
        if (!options.preflightContinue ) {
            res.statusCode = 204;
            res.end();
            //这边加入
            return res.prevent();
        }

在大约268行的地方 加入这个阻止think继续进行下去

//thinkjs 版本 2.2.16

nebelpro commented 7 years ago

你好.我测试了下,是可以阻断的. 但之前上个版本加了http.isAjax判断后有个bug,导致跨域请求被误判放过不进行cors处理

你重新install 下 think-cors 试下,我在目录中也放置了一个example,

npm start 之后,分别以 localhost:8360. 127.0.0.1:8360 访问 examle 进行跨域测试.

pronebel commented 7 years ago

@l-t-yuan 你方便加下QQ么. 910 520 913