Asynchttpserver now uses new uri module for URL parsing.
This commit is contained in:
parent
7358fc256f
commit
eb6ac2a901
1 changed files with 3 additions and 3 deletions
|
|
@ -11,14 +11,14 @@
|
||||||
##
|
##
|
||||||
## **Note:** This module is still largely experimental.
|
## **Note:** This module is still largely experimental.
|
||||||
|
|
||||||
import strtabs, asyncnet, asyncdispatch, parseutils, parseurl, strutils
|
import strtabs, asyncnet, asyncdispatch, parseutils, uri, strutils
|
||||||
type
|
type
|
||||||
TRequest* = object
|
TRequest* = object
|
||||||
client*: PAsyncSocket # TODO: Separate this into a Response object?
|
client*: PAsyncSocket # TODO: Separate this into a Response object?
|
||||||
reqMethod*: string
|
reqMethod*: string
|
||||||
headers*: PStringTable
|
headers*: PStringTable
|
||||||
protocol*: tuple[orig: string, major, minor: int]
|
protocol*: tuple[orig: string, major, minor: int]
|
||||||
url*: TURL
|
url*: TUri
|
||||||
hostname*: string ## The hostname of the client that made the request.
|
hostname*: string ## The hostname of the client that made the request.
|
||||||
body*: string
|
body*: string
|
||||||
|
|
||||||
|
|
@ -135,7 +135,7 @@ proc processClient(client: PAsyncSocket, address: string,
|
||||||
request.headers[kv.key] = kv.value
|
request.headers[kv.key] = kv.value
|
||||||
|
|
||||||
request.reqMethod = reqMethod
|
request.reqMethod = reqMethod
|
||||||
request.url = parseUrl(path)
|
request.url = parseUri(path)
|
||||||
try:
|
try:
|
||||||
request.protocol = protocol.parseProtocol()
|
request.protocol = protocol.parseProtocol()
|
||||||
except EInvalidValue:
|
except EInvalidValue:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue