| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Ensure HttpClient onProgress is called once per second
Ensure that reported speed is accurate
|
|
|
|
|
| |
Some servers will reject authorization requests with a lowercase "basic" type. Changing to "Basic" seems to solve these issues.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Proxy-Authorization
|
|
|
|
| |
This fixes 19253 by marking the bodyStream as completed when no content
was sent.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
postContent (#18208)
* Fixed missing newline after bound marker in mulipart post (#14794) and a problem where calling postContent with multipart data does not set content-length header.
* Update lib/pure/httpclient.nim
* Added comment outlining the reason for changes to httpclient.nim and added tests to ensure that multipart post has a newline at the end of the body, and that the content-length header is present.
* Fixed typo in comments.
* Removed redundant blank lines in thttpclient_standalone.nim.
Co-authored-by: Mark Pointing <mark@futurepoint.com.au>
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
|
|
|
|
|
|
|
|
|
| |
* Improve httpClient docs on SSL cert verification
Cert verification is enabled by default after CVE-2021-29495
* Update httpclient.nim
Co-authored-by: Dominik Picheta <dominikpicheta@googlemail.com>
|
|
|
|
|
|
|
|
|
|
| |
* improve runnableExamples in std/httpclient
* Add synchronous example.
* Update lib/pure/httpclient.nim
Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
* Clean up imports
Fix duplicate 'streams' import.
* Update lib/pure/httpclient.nim
Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
|
|
|
| |
Move 4xx/5xx exception to before disk i/o. As it stands an empty file is created on http error 4xx/5xx.
|
|
|
|
|
|
|
| |
* remove unnecessary when statement
* remove outdated codes
* use warnings
|
| |
|
| |
|
|
|
|
|
|
|
| |
* basic cleanups regarding SSL handling
* enabled certificate checking on Windows
* updated the SSL test
* quoting helps
|
| |
|
|
|
|
|
|
|
|
|
| |
* A new request should always have a new content-length
In [my last PR](https://github.com/nim-lang/Nim/pull/16618) I made a mistake by assuming that the client.headers were cleared on every request, like the Python version. So, due to the fact that Nim keeps the client headers, we need to clear the Content-Length header on each request (which makes sense because you almost never want to use the same Content-Length twice, but you may want to reuse other headers)
* Move content-length to newHeaders instead of in the global client headers
* Use single backticks
|
|
|
|
|
|
|
|
|
| |
* Fix broken links in docs
* Fix rand HSlice links
* Make small text changes in the docs
* Fix typo in contributing docs
|
|
|
|
|
|
|
|
|
| |
* initialize httpclient response bodyStream; prevent SIGSEGV when getBody is false
* Update lib/pure/httpclient.nim
* Update lib/pure/httpclient.nim
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
|
|
|
|
|
|
| |
Move `downloadFileEx` out of `downloadFile` (solution, proposed by
@Yardanico).
Tested manually.
|
|
|
|
|
| |
* Fixes #16436
* Comments addressed
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Allow passing Uri instead of strings
* Teach httpclient about 308
* Deprecate request proc where httpMethod is string
* More use of HttpMethod enum
Also fix handling of 308, I forgot to add the hunk to the previous
commit.
* Well behaved redirect handler
* Also remove Transfer-Encoding
* Removed unused proc
* Secure redirection rules
Strip sensitive headers for cross-domain redirects.
* Allow httpMethod to be a string again
This way unknown http verbs can be used without any problem.
* Respect user-specified Host header
* Missed multipart argument.
* Try another method
* add changelog
* Fix hidden deprecation warning, parseEnum failing
* This is wrong
* Have to do it manually, parseEnum is not suitable
* Review comments
* update
Co-authored-by: LemonBoy <thatlemon@gmail.com>
Co-authored-by: Dominik Picheta <dominikpicheta@googlemail.com>
|
|
|
|
|
|
|
|
|
|
| |
* DELETE requests should always have a content-length header
Not having DELETE in this list is causing hanging when trying to close webdriver sessions in [halonium](https://github.com/halonium/halonium/issues/10) and likely any other implementation of the webdriver protocol. Both at least chromedriver and geckodriver are affected by this issue.
* Change the content length calculation to match the http spec
For reference:
https://www.w3.org/Protocols/HTTP/1.0/draft-ietf-http-spec.html#Entity-Body
|
|
|
|
|
| |
* Fix broken links in docs
* Fix rand HSlice links
|
|
|
|
|
|
|
| |
* Don't add content-length header on GET request when there is no body.
* Add space between the not and the (.
* Take Dom's suggestion.
|
| |
|
| |
|
|
|
|
| |
* prevent newlines where they shouldn't be
* 'contentLength' shouldn't be negative
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
This commit indents the contents of a `code-block` in `httpclient.nim`
so that it displays correctly. The bug was introduced by 42a64245f8.
I did a quick search for other `code-block`s that are broken in the same
way, but the only other one I found (in `pegs.nim`) is not included in
the generated documentation.
|
|
|
|
|
|
|
| |
* update to the latest Jester
* remove deprecated procs from some stdlib modules
* 'criterion' is not maintained anymore and relies on obsolete stuff
|
|
|
|
|
| |
* httpcore: Add http code 308
* httpclient: Add 308 to redirection proc
* fix typo
|
|
|
|
| |
* move since from inclrtl to std/private/since
* move since import in system below for HCR
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Error -> Defect for defects
The distinction between Error and Defect is subjective,
context-dependent and somewhat arbitrary, so when looking at an
exception, it's hard to guess what it is - this happens often when
looking at a `raises` list _without_ opening the corresponding
definition and digging through layers of inheritance.
With the help of a little consistency in naming, it's at least possible
to start disentangling the two error types and the standard lib can set
a good example here.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As the async httpclient is almost certainly the first async example beginners will want to try, we OWE it to them to give them a real example.
Example repeated here for clarity:
```nim
import asyncdispatch, httpclient
proc asyncProc(): Future[string] {.async.} =
var client = newAsyncHttpClient()
return await client.getContent("http://example.com")
echo waitFor asyncProc()
```
This is my first Nim contribution, please let me know if the code is right. (it runs on my machine, but may not be the best example)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Implement SSL/TLS certificate checking #782
* SSL: Add nimDisableCertificateValidation
Remove NIM_SSL_CERT_VALIDATION env var
tests/untestable/thttpclient_ssl.nim ran successfully on Linux with libssl 1.1.1d
* SSL: update integ test to skip flapping tests
* Revert .travis.yml change
* nimDisableCertificateValidation disable imports
Prevent loading symbols that are not defined on older SSL libs
* SSL: disable verification in net.nim
..when nimDisableCertificateValidation is set
* Update changelog
* Fix peername type
* Add define check for windows
* Disable test on windows
* Add exprimental GitHub action CI for SSL
* Test nimDisableCertificateValidation
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add `uploadFile` to POST files by streaming them
* Use constant for \c\L
* Formatting
* Remove uploadFile
* Implement MultipartData file streaming
* Remove unnecessary var annotations
* Call string on TaintedStrings
Fixes #12789
* Move cl constant to httpcore
* Fix `request` inconsistencies
* Update documentaion
* Clean up
* Skip multipart formatting when there's 0 entries
* Remove extraneous `cl` from multipart formatting
* Update MultipartData `$` to match old behaviour
* Update comment
* Address comments
|
|
|
|
| |
headers argument instead of hardcoded empty (#13207)
|
|
|
|
|
|
| |
* Added fix for taint mode in streams and httpclient
* Removed taintMode export from system.nim
|
| |
|
| |
|
|
|
|
| |
(#12754)
|
| |
|
|
|
|
|
| |
* fixes #11863
* improved the code; refs #12412
|
| |
|
| |
|
|
|
|
| |
This reverts commit b865c2a54b7d706b31b5eba29dfdbb16809aa400.
|