allow list on proxy endpoint
This commit is contained in:
1 parent
f6af555573
commit
c234a4f9b3
1 file changed
+9
-1
@@ -15,6 +15,7 @@ namespace Http
|
||||
|
||||
m.innertube = server.sceneNodes.innertube
|
||||
m.profilesService = server.sceneNodes.profilesService
|
||||
m.proxyRequestAllowedKeys = { "Method": true, "Url": true, "Headers": true, "Body": true, "CacheSeconds": true }
|
||||
end function
|
||||
|
||||
@get("/api/innertube/potoken")
|
||||
@@ -108,11 +109,18 @@ namespace Http
|
||||
response = context.response
|
||||
|
||||
requestArgs = request.BodyJson()
|
||||
if requestArgs = invalid
|
||||
if not IsAssociativeArray(requestArgs)
|
||||
response.Default(400, "Invalid request body")
|
||||
return true
|
||||
end if
|
||||
|
||||
for each key in requestArgs
|
||||
if not m.proxyRequestAllowedKeys.DoesExist(key)
|
||||
response.Default(400, `Unsupported key: "${key}"`)
|
||||
return true
|
||||
end if
|
||||
end for
|
||||
|
||||
requestHeaders = requestArgs.Headers
|
||||
' Proxied web-app requests (e.g. BotGuard attestation) may omit a
|
||||
' User-Agent; fall back to ours instead of Roku's default.
|
||||
|
||||
Reference in new issue
Block a user