do not expose Skynet-Requested-Skylink

This commit is contained in:
Karol Wypchlo 2021-08-31 16:39:42 +02:00
parent 626e370832
commit c5afe554b5
No known key found for this signature in database
GPG Key ID: C92C016317A964D0
1 changed files with 16 additions and 0 deletions

View File

@ -216,6 +216,14 @@ location /skynet/pin {
location /skynet/metadata { location /skynet/metadata {
include /etc/nginx/conf.d/include/cors; 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_set_header User-Agent: Sia-Agent;
proxy_pass http://sia:9980; proxy_pass http://sia:9980;
} }
@ -223,6 +231,14 @@ location /skynet/metadata {
location /skynet/resolve { location /skynet/resolve {
include /etc/nginx/conf.d/include/cors; 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_set_header User-Agent: Sia-Agent;
proxy_pass http://sia:9980; proxy_pass http://sia:9980;
} }