add skynet-skylink header to tus final response
This commit is contained in:
parent
b8a6816876
commit
d8e95d4d82
|
@ -334,6 +334,17 @@ server {
|
|||
|
||||
# rewrite tus headers to use correct uri
|
||||
proxy_redirect https://siad/ https://$domain.$tld/;
|
||||
|
||||
# extract skylink from base64 encoded upload metadata and assign to a proper header
|
||||
header_filter_by_lua_block {
|
||||
if ngx.header["Upload-Metadata"] then
|
||||
local encodedSkylink = string.match(ngx.header["Upload-Metadata"], "Skylink ([^,?]+)")
|
||||
|
||||
if encodedSkylink then
|
||||
ngx.header["Skynet-Skylink"] = ngx.decode_base64(encodedSkylink)
|
||||
end
|
||||
end
|
||||
}
|
||||
}
|
||||
|
||||
location /skynet/pin {
|
||||
|
|
|
@ -42,7 +42,7 @@ http {
|
|||
'"$http_user_agent" $upstream_response_time '
|
||||
'$upstream_bytes_sent $upstream_bytes_received '
|
||||
'"$upstream_http_content_type" "$upstream_cache_status" '
|
||||
'"$portal_domain" "$upstream_http_skynet_skylink" '
|
||||
'"$portal_domain" "$sent_http_skynet_skylink" '
|
||||
'$upstream_connect_time $upstream_header_time '
|
||||
'$request_time "$hns_domain"';
|
||||
|
||||
|
|
Reference in New Issue