diff options
-rw-r--r-- | src/server/buffer.nim | 2 | ||||
-rw-r--r-- | src/utils/twtstr.nim | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/server/buffer.nim b/src/server/buffer.nim index 3d466fa8..6da64c83 100644 --- a/src/server/buffer.nim +++ b/src/server/buffer.nim @@ -738,7 +738,7 @@ proc checkRefresh*(buffer: Buffer): CheckRefreshResult {.proxy.} = if s[i] notin {',', ';'}: return CheckRefreshResult(n: -1) i = s.skipBlanks(i + 1) - if s.startsWithIgnoreCase("url=", i): + if s.toOpenArray(i, s.high).startsWithIgnoreCase("url="): i = s.skipBlanks(i + "url=".len) var q = false if i < s.len and s[i] in {'"', '\''}: diff --git a/src/utils/twtstr.nim b/src/utils/twtstr.nim index 44c6ea3f..7cadd41f 100644 --- a/src/utils/twtstr.nim +++ b/src/utils/twtstr.nim @@ -108,9 +108,9 @@ func toHexLower*(u: uint16): string = func equalsIgnoreCase*(s1, s2: string): bool {.inline.} = return s1.cmpIgnoreCase(s2) == 0 -func startsWithIgnoreCase*(s1, s2: string; si = 0): bool = +func startsWithIgnoreCase*(s1, s2: openArray[char]): bool = if s1.len < s2.len: return false - for i in si ..< s2.len: + for i in 0 ..< s2.len: if s1[i].toLowerAscii() != s2[i].toLowerAscii(): return false return true |