Skip to content

Commit 61beec4

Browse files
author
Rubens F. N. da Silva
committed
Enable name passing
This fixes a bug where the SSL connection name was always being set as "DIscord Webhook SSL", Which was using for testing some features.
1 parent cf60036 commit 61beec4

File tree

1 file changed

+29
-29
lines changed

1 file changed

+29
-29
lines changed

cls/Frontier/Shared/Utilities.cls

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ClassMethod RandomString(size, lowerCase As %Boolean = 0, extras = "") As %Strin
77
set alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
88
if lowerCase = 1 set alpha = alpha_$$$lcase(alpha)
99
if extras '= "" set alpha = alpha_extras
10-
10+
1111
while $length(key) < size {
1212
set next = $select($random(2) = 1 : $extract(alpha, $random($length(alpha))), 1: $random(9))
1313
set key = key_next
@@ -19,28 +19,28 @@ ClassMethod SanitizeFilename(fileName) As %String
1919
{
2020
if fileName [ "/" set fileName = $piece(fileName, "/", *)
2121
if fileName [ "\" set fileName = $piece(fileName, "\", *)
22-
22+
2323
set fileName = $translate(fileName, "àáÁÀÂâÃÁÂÃãèéÉÈêÊÉìíÍÌÎîòóÓÒÔôÕÓÔõùúÚÙÛûÇçÖöÜüÑ ", "aaAAAaAAAAaeeEEeEEiiIIIiooOOOOOoOouuUUUuCcOoUuN-")
2424
return $zstrip(fileName, "*E'N'A", "", "_-@.")
2525
}
2626

2727
ClassMethod ReplacePlaceholders(definitions As %DynamicObject) As %String
2828
{
2929
set text = definitions.text
30-
30+
3131
set it = definitions.placeholders.%GetIterator()
32-
while it.%GetNext(.key, .value) { set text = $replace(text, key, value) }
33-
32+
while it.%GetNext(.key, .value) { set text = $replace(text, key, value) }
33+
3434
return text
3535
}
3636

3737
ClassMethod DeepExtend(sources... As %DynamicObject) As %DynamicObject
3838
{
39-
39+
4040
#dim result As %DynamicObject
41-
42-
set result = {}
43-
41+
42+
set result = {}
43+
4444
for i=1:1:sources {
4545
set iterator = sources(i).%GetIterator()
4646
while iterator.%GetNext(.property, .value) {
@@ -53,7 +53,7 @@ ClassMethod DeepExtend(sources... As %DynamicObject) As %DynamicObject
5353
}
5454
} elseif 'result.%IsDefined(property) {
5555
set $property(result, property) = value
56-
}
56+
}
5757
}
5858
}
5959
return result
@@ -63,7 +63,7 @@ ClassMethod SafeClassMethodCall(expression As %String, args... As %String) As %S
6363
{
6464
set sc = $$$OK
6565
if expression = "" return sc
66-
66+
6767
set class = $piece(expression, ":")
6868
set method = $piece(expression, ":", 2)
6969
try {
@@ -77,7 +77,7 @@ ClassMethod SafeClassMethodCall(expression As %String, args... As %String) As %S
7777
ClassMethod SafeMethodCallAndReturn(sc As %Status = {$$$OK}, instance As %RegisteredObject, method As %String, args...)
7878
{
7979
set ret = ""
80-
80+
8181
try {
8282
set ret = $method(instance, method, args...)
8383
if $extract(ret, 1, 2) = "0 " && $lv($p(ret, " ", 2)) {
@@ -106,36 +106,36 @@ ClassMethod URLBase64Decode(value As %String) As %String
106106
ClassMethod CallAndCapture(object, method As %String, Output str As %Stream.GlobalCharacter = "", args... As %String) As %Status [ ProcedureBlock = 0 ]
107107
{
108108
new oldMnemonic, alreadyRedirected, sc
109-
109+
110110
set sc = $$$OK
111-
set isRedirected = 0
112-
111+
set isRedirected = 0
112+
113113
set str = ##class(%Stream.GlobalCharacter).%New()
114114
set alreadyRedirected = ##class(%Device).ReDirectIO()
115115
set oldMnemonic = ##class(%Device).GetMnemonicRoutine()
116-
set initIO = $io
117-
118-
try {
119-
use $io::("^"_$zname)
116+
set initIO = $io
117+
118+
try {
119+
use $io::("^"_$zname)
120120
do ##class(%Device).ReDirectIO(1)
121121
if $isobject(object) set sc = $method(object, method, args...)
122122
else set class = object set sc = $classmethod(class, method, args...)
123123
do str.Rewind()
124124
} catch ex {
125125
set str = ""
126126
set sc = ex.AsStatus()
127-
}
128-
127+
}
128+
129129
if oldMnemonic '= "" {
130130
use initIO::("^"_oldMnemonic)
131131
} else {
132132
use oldMnemonic
133133
}
134-
134+
135135
do ##class(%Device).ReDirectIO(alreadyRedirected)
136-
136+
137137
return sc
138-
138+
139139
wstr(s) Do str.Write(s) Quit
140140
wchr(a) Do str.Write($char(a)) Quit
141141
wnl Do str.Write($char(13,10)) Quit
@@ -145,14 +145,14 @@ rstr(len,time) Quit ""
145145
rchr(time) Quit ""
146146
}
147147

148-
ClassMethod CreateSSLConfigurationIfNoneExists(name As %String) [ Private ]
148+
ClassMethod CreateSSLConfigurationIfNoneExists(name As %String)
149149
{
150150
new $namespace
151151
set $namespace = "%SYS"
152-
152+
153153
do ##class(Security.SSLConfigs).Get("Discord Webhook SSL", .p)
154-
if $data(p) quit
155-
154+
if $data(p) quit
155+
156156
set p("CipherList")="ALL:!aNULL:!eNULL:!EXP:!SSLv2"
157157
set p("CAFile")=""
158158
set p("CAPath")=""
@@ -169,7 +169,7 @@ ClassMethod CreateSSLConfigurationIfNoneExists(name As %String) [ Private ]
169169
set p("Type")=0
170170
set p("VerifyDepth")=9
171171
set p("VerifyPeer")=0
172-
172+
173173
do ##class(Security.SSLConfigs).Create(name, .p)
174174
}
175175

0 commit comments

Comments
 (0)