diff options
author | bptato <nincsnevem662@gmail.com> | 2023-08-13 17:42:34 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-08-13 17:54:05 +0200 |
commit | d526deb99e44f2a8d1a9c3eea60676703dd64302 (patch) | |
tree | f63689ff7654d14ad9bca182a837b3155b2471a0 /src/io/request.nim | |
parent | f92e30232252deb194596e7c298cc7fcf56517cb (diff) | |
download | chawan-d526deb99e44f2a8d1a9c3eea60676703dd64302.tar.gz |
Add mailcap, mime.types & misc refactorings
* add mailcap: works with copiousoutput, needsterminal, etc. * add mime.types (only works with mailcap) * refactor pipeBuffer * remove "dispatcher" * fix bug in directory display where baseurl would not be used
Diffstat (limited to 'src/io/request.nim')
-rw-r--r-- | src/io/request.nim | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/io/request.nim b/src/io/request.nim index 4ddd5d6d..f609360b 100644 --- a/src/io/request.nim +++ b/src/io/request.nim @@ -73,6 +73,7 @@ type destination* {.jsget.}: RequestDestination credentialsMode* {.jsget.}: CredentialsMode proxy*: URL #TODO do something with this + canredir*: bool ReadableStream* = ref object of Stream isource*: Stream @@ -154,7 +155,8 @@ proc newReadableStream*(isource: Stream): ReadableStream = func newRequest*(url: URL, httpmethod = HTTP_GET, headers = newHeaders(), body = opt(string), multipart = opt(FormData), mode = RequestMode.NO_CORS, credentialsMode = CredentialsMode.SAME_ORIGIN, - destination = RequestDestination.NO_DESTINATION, proxy: URL = nil): Request = + destination = RequestDestination.NO_DESTINATION, proxy: URL = nil, + canredir = false): Request = return Request( url: url, httpmethod: httpmethod, @@ -169,7 +171,8 @@ func newRequest*(url: URL, httpmethod = HTTP_GET, headers = newHeaders(), func newRequest*(url: URL, httpmethod = HTTP_GET, headers: seq[(string, string)] = @[], body = opt(string), - multipart = opt(FormData), mode = RequestMode.NO_CORS, proxy: URL = nil): + multipart = opt(FormData), mode = RequestMode.NO_CORS, proxy: URL = nil, + canredir = false): Request = let hl = newHeaders() for pair in headers: |