Fix jigsaw test. (#301)

This commit is contained in:
Eugene Kabanov 2022-07-30 23:16:30 +03:00 committed by GitHub
parent e9d0e2d208
commit 79c51914ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -689,12 +689,13 @@ suite "HTTP client testing suite":
return "redirect-" & $res
proc testBasicAuthorization(): Future[bool] {.async.} =
var session = createSession(true, maxRedirections = 10)
let url = parseUri("https://user:passwd@httpbin.org/basic-auth/user/passwd")
let session = HttpSessionRef.new({HttpClientFlag.NoVerifyHost},
maxRedirections = 10)
let url = parseUri("https://guest:guest@jigsaw.w3.org/HTTP/Basic/")
let resp = await session.fetch(url)
await session.closeWait()
if (resp.status == 200) and
("true," in cast[string](resp.data)):
("Your browser made it!" in bytesToString(resp.data)):
return true
else:
return false