标签:中间件 nbsp ons -o rem RoCE process head res
本质设置响应头
定制中间件 cors.py 后在settings.py中间件中配置
class CORSMiddleware(MiddlewareMixin): def process_response(self,request,response): # 添加响应头 # 允许你的域名来获取我的数据 response[‘Access-Control-Allow-Origin‘] = "*" # 允许你携带Content-Type请求头 response[‘Access-Control-Allow-Headers‘] = "Content-Type" # 允许你发送DELETE,PUT response[‘Access-Control-Allow-Methods‘] = "DELETE,PUT" return response
标签:中间件 nbsp ons -o rem RoCE process head res
原文地址:https://www.cnblogs.com/hanbowen/p/9900223.html