mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:48:45 +08:00
fix: 修复 mock 接口 cors headers 返回错误
This commit is contained in:
parent
195048b43b
commit
e08c4873fc
@ -54,7 +54,7 @@ function mockResponse(event, context, callback) {
|
||||
function createHeaders(headers) {
|
||||
let referer = '';
|
||||
|
||||
if (/^(https?\:\/\/[^:\/]+(?:\:\d+)?\/)/i.test(headers['Referer'])) {
|
||||
if (/^(https?\:\/\/[^:\/]+(?:\:\d+)?\/)/i.test(headers['referer'])) {
|
||||
referer = RegExp.$1.replace(/\/$/, '');
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user