diff options
| author | bptato <nincsnevem662@gmail.com> | 2024-11-11 17:19:38 +0100 |
|---|---|---|
| committer | bptato <nincsnevem662@gmail.com> | 2024-11-11 21:19:52 +0100 |
| commit | 23beebe67a445aaeeae20a5cd80ff522db1b0ddb (patch) | |
| tree | 7c29e0be74bc78b02492b31751383096ce1cffdd /src/types/cookie.nim | |
| parent | bce7d58e6e6e54814b74d9d41766f98552206e32 (diff) | |
| download | chawan-23beebe67a445aaeeae20a5cd80ff522db1b0ddb.tar.gz | |
url: reduce URL object size, simplify
* query, fragment are now strings, not options
* get rid of Host, Path types, now hostname/pathname are strings
* fix ipv4 parsing error case
* in file protocol, fix URL for dirlist without slash with a redirection
Diffstat (limited to 'src/types/cookie.nim')
| -rw-r--r-- | src/types/cookie.nim | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/types/cookie.nim b/src/types/cookie.nim index 78a10f81..305af9fa 100644 --- a/src/types/cookie.nim +++ b/src/types/cookie.nim @@ -125,7 +125,7 @@ proc `$`*(cookiejar: CookieJar): string = # https://www.rfc-editor.org/rfc/rfc6265#section-5.1.4 func defaultCookiePath(url: URL): string = - let path = ($url.path).beforeLast('/') + let path = url.pathname.beforeLast('/') if path == "" or path[0] != '/': return "/" return path @@ -197,7 +197,7 @@ proc serialize*(cookiejar: CookieJar; url: URL): string = continue if cookie.secure and url.scheme != "https": continue - if not cookiePathMatches(cookie.path, $url.path): + if not cookiePathMatches(cookie.path, url.pathname): continue if not cookieDomainMatches(cookie.domain, url): continue |