mirror of
https://github.com/CFC-Servers/cfc_cl_http_whitelist.git
synced 2025-03-04 03:03:18 -05:00
add tests to github actions
This commit is contained in:
parent
9ac967db05
commit
34a07f9e2b
8
.github/workflows/gluatest.yml
vendored
Normal file
8
.github/workflows/gluatest.yml
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
name: GLuaTest Runner
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
run-tests:
|
||||
uses: CFC-Servers/GLuaTest/.github/workflows/gluatest.yml@main
|
@ -20,7 +20,7 @@ local function logRequest( method, url, fileLocation, allowed, noisy )
|
||||
if not url then
|
||||
url = "unknown"
|
||||
elseif isVerbose == false then
|
||||
local address = CFCHTTP.getAddress( url )
|
||||
local address = CFCHTTP.GetAddress( url )
|
||||
if noisy then return end
|
||||
|
||||
url = address
|
||||
|
@ -1,23 +1,5 @@
|
||||
CFCHTTP = CFCHTTP or {}
|
||||
|
||||
|
||||
local parsedAddressCache = {}
|
||||
---@parm url string
|
||||
---@return string
|
||||
function CFCHTTP.getAddress( url )
|
||||
local cached = parsedAddressCache[url]
|
||||
if cached then return cached end
|
||||
|
||||
local data = CFCHTTP.ParseURL( url )
|
||||
parsedAddressCache[url] = data.address
|
||||
|
||||
return data.address
|
||||
end
|
||||
|
||||
function CFCHTTP.isAssetURI( url )
|
||||
return string.StartWith( url, "asset://" )
|
||||
end
|
||||
|
||||
-- escapes all lua pattern characters and allows the use of * as a wildcard
|
||||
local escapedCache = {}
|
||||
local function escapeAddr( addr )
|
||||
|
@ -33,3 +33,21 @@ function CFCHTTP.FindURLs( text )
|
||||
|
||||
return urls
|
||||
end
|
||||
|
||||
local parsedAddressCache = {}
|
||||
---@parm url string
|
||||
---@return string
|
||||
function CFCHTTP.GetAddress( url )
|
||||
local cached = parsedAddressCache[url]
|
||||
if cached then return cached end
|
||||
|
||||
local data = CFCHTTP.ParseURL( url )
|
||||
parsedAddressCache[url] = data.address
|
||||
|
||||
return data.address
|
||||
end
|
||||
|
||||
function CFCHTTP.IsAssetURI( url )
|
||||
return string.StartWith( url, "asset://" )
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user