Merge pull request #1120 from SkynetLabs/do-not-expose-requested-skylink-header

do not expose Skynet-Requested-Skylink
This commit is contained in:
Matthew Sevey 2021-08-31 10:44:50 -04:00 committed by GitHub
commit b4a7a0f058
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 0 deletions

View File

@ -216,6 +216,14 @@ location /skynet/pin {
location /skynet/metadata {
include /etc/nginx/conf.d/include/cors;
header_filter_by_lua_block {
ngx.header["Skynet-Portal-Api"] = os.getenv("SKYNET_PORTAL_API")
ngx.header["Skynet-Server-Api"] = os.getenv("SKYNET_SERVER_API")
-- do not expose internal header
ngx.header["Skynet-Requested-Skylink"] = ""
}
proxy_set_header User-Agent: Sia-Agent;
proxy_pass http://sia:9980;
}
@ -223,6 +231,14 @@ location /skynet/metadata {
location /skynet/resolve {
include /etc/nginx/conf.d/include/cors;
header_filter_by_lua_block {
ngx.header["Skynet-Portal-Api"] = os.getenv("SKYNET_PORTAL_API")
ngx.header["Skynet-Server-Api"] = os.getenv("SKYNET_SERVER_API")
-- do not expose internal header
ngx.header["Skynet-Requested-Skylink"] = ""
}
proxy_set_header User-Agent: Sia-Agent;
proxy_pass http://sia:9980;
}