Closed Jiang-Xuan closed 4 years ago
const response = await request(app)
.options('/api/v1/images')
expect(response.header['access-control-allow-methods']).toEqual('post, get, options, delete')
expect(response.header['access-control-allow-origin']).toEqual('*')
expect(response.header['access-control-allow-headers']).toEqual('*')
2020.3.25 更新, 这里存在错误,
post, get, options
等应该是大写 见 #91删除图片的请求为
DELETE https://beta.tuchuang.space/api/v1/images
如果是跨域的 DELETE 请求, 目前返回的跨域请求头为:
需要添加 DELETE 来允许跨域的 DELETE 请求: