flask how to get the HTTP_ORIGIN of a request

后端 未结 3 1012
时光说笑
时光说笑 2021-02-06 07:43

I\'d like to make a response with the \"Access-Control-Allow-Origin\" header been set all by myself, while it\'s seems messing up to figure out where the \"HTTP_ORIGIN\" paramet

3条回答
  •  旧巷少年郎
    2021-02-06 08:02

    This will get you the answer

    from flask import request
    ...
    if request.environ['HTTP_ORIGIN'] is not None:
        print request.environ['HTTP_ORIGIN']
    

提交回复
热议问题