Commit Graph

174 Commits

Author SHA1 Message Date
xioren
a7570ff0c2 Relocate 4xx/5xx exception in downloadFile (#17332) [backport:1.2]
Move 4xx/5xx exception to before disk i/o. As it stands an empty file is created on http error 4xx/5xx.

(cherry picked from commit 3d198fdcc2)
2021-03-18 17:30:15 +01:00
Andreas Rumpf
793bd0a977 basic cleanups regarding SSL handling (#16940) [backport:1.0]
* basic cleanups regarding SSL handling
* enabled certificate checking on Windows
* updated the SSL test
* quoting helps

(cherry picked from commit abac35e743)
2021-02-08 17:26:07 +01:00
Miran
e71395f571 fix several newline problems (#15028) [backend]
* prevent newlines where they shouldn't be
* 'contentLength' shouldn't be negative

(cherry picked from commit 5fafa2fd5c)
2020-07-22 15:47:58 +02:00
Federico Ceratto
5b85444244 SSL certificate verify GitHub action (#13697)
* 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
2020-03-20 17:11:39 +01:00
Zed
e056298ceb Implement file streaming for httpclient's MultipartData (#12982)
* 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
2020-03-06 18:55:45 +00:00
Juan Carlos
2fad7f134f httpclient, maxredirects to Natural, newHttpClient/newAsyncHttpClient add headers argument instead of hardcoded empty (#13207) 2020-01-21 19:34:47 +01:00
Sam Wang
441cacf70f Added fix for handling TaintedStrings in streams and httpclient (#12969)
* Added fix for taint mode in streams and httpclient

* Removed taintMode export from system.nim
2019-12-29 17:37:22 +01:00
Jack Tang
21ea1094ef Allow customize Host header 2019-12-28 17:26:02 +00:00
Pierre-Jean Grenier
a114a40b57 fix httpclient.lastModified bad pattern in parsing (#12698) 2019-11-29 11:17:10 +01:00
3n-k1
0944b0f441 [backport] Fix style issues in lib/, tools/, and testament/. Fixes #12687. (#12754) 2019-11-28 08:32:11 +01:00
Andy Davidoff
bd8f49cbd3 replace some runtime repr in stdlib for gc:arc (#12716) 2019-11-25 10:13:30 +01:00
Andreas Rumpf
e5478b32a8 fixes #11863 multipart data need $ (#12707)
* fixes #11863
* improved the code; refs #12412
2019-11-22 14:21:03 +01:00
treeform
5ba932e43c About 50% faster base64 implemention. (#12436) 2019-10-17 09:50:00 +02:00
narimiran
0ca9cc7419 [backport] run nimpretty on web stuff 2019-09-30 13:58:11 +02:00
narimiran
f7a8fc46c0 Revert "improvements for httpcore (#12228)"
This reverts commit b865c2a54b.
2019-09-23 19:06:55 +02:00
Andreas Rumpf
b865c2a54b improvements for httpcore (#12228)
* improvements for httpcore
* further improvements, now stable API but needs extensions later on
2019-09-23 12:38:35 +02:00
Dominik Picheta
8117a949c5 Remove old and unused parseBody/parseResponse procs in httpclient. (#11949) 2019-08-26 20:27:44 +02:00
Dominik Picheta
b095203f28 Fixes regression introduced by #11904. (#11948) 2019-08-15 06:05:38 +02:00
konradmb
addd7b5e20 Fix issue #10726 - HTTP response without Content-Length is not accessible (#11904)
* Add patch by @xenogenesi

* Async test for HTTP/1.1 without Content-Length

* Apply suggestions from code review

Co-Authored-By: Dominik Picheta <dominikpicheta@googlemail.com>
2019-08-08 08:41:56 +02:00
Oscar Nihlgård
1f32498a47 Use std/monotimes in the stdlib 2019-07-16 11:05:42 +02:00
Araq
bc7733827d make more parts of the stdlib compile with --styleCheck:error 2019-07-10 15:48:30 +02:00
Juan Carlos
22a1b12038 [documentation] fix #11281, httpclient examples (#11455) 2019-06-10 09:31:57 +02:00
Boris Shomodjvarac
de6b2e88d2 added getSocket proc (#11233) 2019-05-15 17:47:25 +02:00
Juan Carlos
dcbab1031a Fixes #10357 (#10618) 2019-02-13 23:30:14 +01:00
Mandeep Singh
a0623a2356 Updated httpClient.nim: added import httpClient statements in examples
Added import httpClient statements in examples, as it was not obvious for a new started from python regarding what to import
2019-01-26 14:45:26 +00:00
Miran
214f48eae9 Remove long deprecated stuff (#10332) 2019-01-18 07:18:32 +01:00
Dominik Picheta
47d0582ebf Merge pull request #9548 from tonygparsehub/put-delete
fix #8777 add missing http methods in httpClient
2018-11-23 22:45:28 +00:00
Araq
3f6168b337 removes deprecated T/P types 2018-11-16 13:27:56 +01:00
Tony G
4bb472effd fix #8777 add missing http methods in httpClient 2018-10-30 21:01:09 -04:00
David Krause
f2cd8ed99a fixes #7842 if no uri.scheme specified raise ValueError with hint (#7846)
* fixes #7842 if no uri.scheme specified on request rais ValueError with hint

Signed-off-by: enthus1ast <david@code0.xyz>

* Update httpclient.nim
2018-10-27 21:54:45 +01:00
Araq
64517445ea even more strict isNil handling for strings/seqs in order to detect bugs 2018-08-22 12:35:46 +02:00
Araq
420ed0596b fixes more nil handling regressions 2018-08-13 17:27:44 +02:00
Andreas Rumpf
7f49364fd0 make more tests green 2018-08-13 12:29:03 +02:00
Emery Hemingway
817e4bb2fe AsyncHttpClient: return from requests before body completion
Store the body completion future at the client and wait for it to
complete before issuing additional requests. This allows the body
FutureStream reader to drain the stream and read buffers to be freed
asynchronously.

Fix #8109
2018-08-08 07:48:24 +02:00
Federico Ceratto
059ddeee10 Minor doc fix 2018-06-23 14:32:24 +01:00
Andreas Rumpf
c6a9a9c30b hotfix: fixes SSL initialization for httpclient with --threads:on (#7863)
* hotfix: fixes SSL initialization for httpclient with --threads:on
2018-05-22 23:07:02 +02:00
Araq
bbb0fd4eb7 remove deprecated stuff from the stdlib; introduce better deprecation warnings 2018-05-05 21:45:07 +02:00
Dominik Picheta
608017801d Fixes crash in httpclient due to new string indexing rules. 2018-05-04 22:26:16 +01:00
Andreas Rumpf
aeca422dbe make httpclient work without zero terminators 2018-04-29 07:59:36 +02:00
hlaaf
397e173139 fix #7680 (#7683)
* fix #7680

* Don't send on every HTTP method

* These should be squashed

* 80 column limit
2018-04-26 18:54:14 +01:00
Dominik Picheta
d01b1558a3 Improve progress reporting example. Refs #7693 2018-04-25 22:49:29 +01:00
David Krause
be8ce30acd copy pastable progress reporting example 2018-04-25 16:06:53 +02:00
Dominik Picheta
992300b300 Call requestAux not request in httpclient. 2018-04-07 18:16:08 +01:00
Araq
710c1184a3 fixes httpclient documentation comment 2018-03-12 08:59:04 +01:00
Dominik Picheta
fb3e460f6d Improve SSL error message in httpclient. 2018-02-22 10:49:27 +00:00
Dominik Picheta
864467ade3 Merges #7226 manually. 2018-02-19 12:14:45 +00:00
Dominik Picheta
ef19634065 Workaround 'defer' issue in httpclient.downloadFile. Refs #3877. (#7101) 2018-01-18 14:08:35 +01:00
Yuriy Glukhov
cfc0a58417 Fixed crash in ssl httpclient 2018-01-11 23:02:42 +02:00
Ganesh Viswanathan
686a2aaefa Fixes httpclient proxies. Fixes #6685 (#6694)
* Fix for #6685

* Fixed test breakage - SSL call wasn't within when defined(ssl) check
2017-11-07 13:51:09 +00:00
Dominik Picheta
ac67f5eda5 Fixes req w/ both Content-Length & Connection: close headers.
Also closes the socket when connection is closed to ensure
that a new connection is made on any further requests.
2017-10-13 21:14:06 +01:00