* Logger

* etag cache fix

* xml refactor

* whitespace

* NodePathUtils

* Http2
This commit is contained in:
Brahim Hadriche authored and GitHub committed 2024-02-05 09:56:22 -05:00
1 parent 44ee6681c5
commit f3aeb58b38
13 files changed
+104 -75

No files matched your search

@@ -242,6 +242,11 @@ namespace HttpClient
return m
end function
function UseHttp2() as HttpRequest
m._useHttp2 = true
return m
end function
function Cancellation(cancellation as object) as HttpRequest
m._cancellation = cancellation
return m
@@ -261,6 +266,10 @@ namespace HttpClient
command += ` \\\n --compressed`
end if
if m._useHttp2 = true
command += ` \\\n --http2`
end if
if m._headers <> invalid
for each key in m._headers
command += ` \\\n -H '${key}: ${m._headers[key]}'`
@@ -489,6 +498,11 @@ namespace HttpClient
urlTransfer.SetCertificatesFile("common:/certs/ca-bundle.crt")
urlTransfer.InitClientCertificates()
end if
if m._useHttp2 = true
urlTransfer.SetHttpVersion("http2")
end if
return urlTransfer
end function
@@ -32,6 +32,17 @@ class XmlObject
end if
end function
function TextNode(name as string, text as string, attributes = invalid as object)
m.Node(name, attributes)
m.Text(text)
m.End()
end function
function EmptyNode(name as string, attributes = invalid as object)
m.Node(name, attributes)
m.End()
end function
function End()
m.stack.pop()
end function
@@ -0,0 +1,35 @@
namespace NodePathUtils
function FindNodeFromPath(root as object, path as string) as object
node = root
if path.StartsWith("/")
node = node.getScene()
path = path.Mid(1)
end if
pathParts = path.Tokenize("/")
for i = 0 to pathParts.Count() - 1
if node = invalid
return invalid
end if
if pathParts[i] = "."
continue for
end if
if pathParts[i] = ".."
node = node.getParent()
continue for
end if
node = node.findNode(pathParts[i])
end for
if root.isSameNode(node)
' if a node is referencing itself, it's probably a mistake
return invalid
end if
return node
end function
end namespace