fix typo in bunkernet.lua, add missing Origin header in cors tests and fix allow origin expected value
This commit is contained in:
parent
7d84e03a15
commit
4378f18cc8
|
@ -15,8 +15,8 @@ function bunkernet:initialize()
|
|||
local id, err = self.datastore:get("plugin_bunkernet_id")
|
||||
if id then
|
||||
self.bunkernet_id = id
|
||||
self.version = ngx.ctx.bw and ngx.ctx.bw.version or utils.get_version()
|
||||
self.integration = ngx.ctx.bw and ngx.ctw.bw.integration or utils.get_integration()
|
||||
self.version = (ngx.ctx.bw and ngx.ctx.bw.version) or utils.get_version()
|
||||
self.integration = (ngx.ctx.bw and ngx.ctx.bw.integration) or utils.get_integration()
|
||||
else
|
||||
self.logger:log(ngx.ERR, "can't get BunkerNet ID from datastore : " .. err)
|
||||
end
|
||||
|
|
|
@ -39,7 +39,7 @@ try:
|
|||
firefox_options.add_argument("--headless")
|
||||
|
||||
use_cors = getenv("USE_CORS", "no")
|
||||
cors_allow_origin = getenv("CORS_ALLOW_ORIGIN", "*")
|
||||
cors_allow_origin = getenv("CORS_ALLOW_ORIGIN", "*").replace("%.", ".")
|
||||
cors_expose_headers = getenv("CORS_EXPOSE_HEADERS", "Content-Length,Content-Range")
|
||||
cors_max_age = getenv("CORS_MAX_AGE", "86400")
|
||||
cors_allow_credentials = getenv("CORS_ALLOW_CREDENTIALS", "no") == "yes"
|
||||
|
@ -61,7 +61,7 @@ try:
|
|||
)
|
||||
|
||||
response = head(
|
||||
"https://www.example.com", headers={"Host": "www.example.com"}, verify=False
|
||||
"https://www.example.com", headers={"Host": "www.example.com", "Origin": "https://www.example.com"}, verify=False
|
||||
)
|
||||
response.raise_for_status()
|
||||
|
||||
|
@ -119,7 +119,7 @@ try:
|
|||
)
|
||||
|
||||
response = options(
|
||||
"https://www.example.com", headers={"Host": "www.example.com"}, verify=False
|
||||
"https://www.example.com", headers={"Host": "www.example.com", "Origin": "https://www.example.com"}, verify=False
|
||||
)
|
||||
response.raise_for_status()
|
||||
|
||||
|
|
Loading…
Reference in New Issue