adjust hls headers

This commit is contained in:
Brahim Hadriche committed 2025-06-19 10:33:37 -04:00
1 parent e3c0c026f9
commit 56872bfd8a
2 files changed
+15 -7

No files matched your search

@@ -25,8 +25,9 @@ namespace Http
hlsRequest = HttpClient.Get(url)
headers = request.headers
' Host is probably 127.0.0.1 so we should remove it before hitting the server
headers.Delete("Host")
' Host is probably 127.0.0.1:8888 so we should change it before hitting the server
parsedUrl = UrlUtils.ParseUrl(url)
headers["Host"] = parsedUrl.host + ":" + parsedUrl.port
hlsRequest.Headers(headers)
hlsResponse = hlsRequest.Await()
@@ -46,9 +47,12 @@ namespace Http
response.http_code = hlsResponse.StatusCode()
headers = hlsResponse.Headers()
' We responding with uncompressed data
headers.Delete("Content-Encoding")
response.headers = headers
response.headers["Cache-Control"] = headers["no-cache, must-revalidate"]
response.headers["Content-Type"] = headers["Content-Type"]
response.headers["Cross-Origin-Resource-Policy"] = "cross-origin"
response.headers["Date"] = headers["Date"]
response.headers["Server"] = "HTTP server (unknown)"
response.SetBodyDataString(ValidString(hlsManifest))
return true
@@ -161,8 +161,12 @@ ${m.GeneratedBy()}
code = m.http_code
title = m.server.utils.HttpTitle(code)
m.headers["Date"] = m.Now()
m.headers["Server"] = m.settings.serverName
if not m.headers.DoesExist("Date")
m.headers["Date"] = m.Now()
end if
if not m.headers.DoesExist("Server")
m.headers["Server"] = m.settings.serverName
end if
if not m.headers.DoesExist("Connection")
m.KeepAlive(false)