mirror of
https://github.com/gmod-integration/lua.git
synced 2025-03-16 22:37:34 +00:00
Fix: hide /bugs screenshots
This commit is contained in:
parent
b39a1e2349
commit
eed6ccf2a6
|
@ -7,9 +7,13 @@ local function getAPIURL(endpoint)
|
||||||
return method .. "://" .. gmInte.config.apiFQDN .. "/" .. apiVersion .. endpoint
|
return method .. "://" .. gmInte.config.apiFQDN .. "/" .. apiVersion .. endpoint
|
||||||
end
|
end
|
||||||
|
|
||||||
local function showableBody(endpoint)
|
local function showableBody(endpoint, body)
|
||||||
if string.sub(endpoint, 1, 8) == "/streams" || string.sub(endpoint, 1, 12) == "/screenshots" then return false end
|
if endpoint == "/clients/:steamID64/servers/:serverID/screenshots" then
|
||||||
return true
|
body.screenshot = "[IMAGE DATA]"
|
||||||
|
elseif endpoint == "/clients/:steamID64/servers/:serverID/bugs" then
|
||||||
|
body.screenshot.screenshot = "[IMAGE DATA]"
|
||||||
|
end
|
||||||
|
return util.TableToJSON(body || {})
|
||||||
end
|
end
|
||||||
|
|
||||||
function gmInte.http.requestAPI(params)
|
function gmInte.http.requestAPI(params)
|
||||||
|
@ -39,7 +43,7 @@ function gmInte.http.requestAPI(params)
|
||||||
gmInte.log("HTTP FQDN: " .. gmInte.config.apiFQDN, true)
|
gmInte.log("HTTP FQDN: " .. gmInte.config.apiFQDN, true)
|
||||||
gmInte.log("HTTP Request ID: " .. localRequestID, true)
|
gmInte.log("HTTP Request ID: " .. localRequestID, true)
|
||||||
gmInte.log("HTTP Request: " .. method .. " " .. url, true)
|
gmInte.log("HTTP Request: " .. method .. " " .. url, true)
|
||||||
gmInte.log("HTTP Body: " .. (showableBody(params.endpoint) && body || "HIDDEN"), true)
|
gmInte.log("HTTP Body: " .. showableBody(params.endpoint, params.body), true)
|
||||||
HTTP({
|
HTTP({
|
||||||
["url"] = url,
|
["url"] = url,
|
||||||
["method"] = method,
|
["method"] = method,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user