Fix tests.
This commit is contained in:
parent
d595e0dbc6
commit
d6a39e46e1
|
@ -1046,6 +1046,14 @@ proc respond*(req: HttpRequestRef, code: HttpCode, content: string,
|
||||||
await response.sendBody(content)
|
await response.sendBody(content)
|
||||||
return response
|
return response
|
||||||
|
|
||||||
|
proc remoteAddress*(conn: HttpConnectionRef): TransportAddress =
|
||||||
|
## Returns address of the remote host that established connection ``conn``.
|
||||||
|
conn.transp.remoteAddress()
|
||||||
|
|
||||||
|
proc remoteAddress*(request: HttpRequestRef): TransportAddress =
|
||||||
|
## Returns address of the remote host that made request ``request``.
|
||||||
|
request.connection.remoteAddress()
|
||||||
|
|
||||||
proc requestInfo*(req: HttpRequestRef, contentType = "text/text"): string {.
|
proc requestInfo*(req: HttpRequestRef, contentType = "text/text"): string {.
|
||||||
raises: [Defect].} =
|
raises: [Defect].} =
|
||||||
## Returns comprehensive information about request for specific content
|
## Returns comprehensive information about request for specific content
|
||||||
|
|
|
@ -262,7 +262,7 @@ suite "HTTP server testing suite":
|
||||||
let data = await httpClient(address, "GET / HTTP/1.1\r\n\r\n")
|
let data = await httpClient(address, "GET / HTTP/1.1\r\n\r\n")
|
||||||
await server.stop()
|
await server.stop()
|
||||||
await server.closeWait()
|
await server.closeWait()
|
||||||
return serverRes and (data.startsWith("HTTP/1.1 413"))
|
return serverRes and (data.startsWith("HTTP/1.1 431"))
|
||||||
|
|
||||||
check waitFor(testTooBig(initTAddress("127.0.0.1:30080"))) == true
|
check waitFor(testTooBig(initTAddress("127.0.0.1:30080"))) == true
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue