Commit graph

107 commits

Author SHA1 Message Date
Andrey Makarov
42687457b0
further progress on rst roles & directives (fix #17646) (#17659)
* further progress on rst roles & dir-s (fix #17646)

* fix documents according to the messages

* fix bug 17 from #17340
2021-04-08 19:00:14 +02:00
Dominik Picheta
65efa727ff
Removes asynchttpserver.getSocket. (#17587) 2021-03-31 18:20:42 +02:00
Timothee Cour
72988509ba
add getPort to resolve Port(0) (#17559)
* add getPort to resolve Port(0)

* fixup

* use getPort in examples + tests

* address comments: do not re-export Port
2021-03-30 20:14:39 +02:00
Timothee Cour
dd6b0f81ef
use -r:off for runnableExamples that should compile but not run (#17203)
* use -r:off for runnableExamples that should compile but not run

* use -r:off in other RT disabled tests
2021-03-01 14:26:39 +01:00
Danil Yarantsev
56461c280f
Change stdlib imports to use std prefix in most examples (#17202) 2021-02-28 13:17:19 -08:00
flywind
47c078e29c
use single backtick (#17166) 2021-02-23 21:05:39 -08:00
vabresto
a90f7a66ed
Transfer-Encoding:chunked tests (#16678)
* Add tests and fix extra newlines in body

* Fixes per comments

* Slight rephrase per comments

* Improvements per comments

* Add getSocket to reduce test flakiness per comment

* Remove unused lines from header

* Add doc comment to getSocket per comment

* Apply witchcraft to replace `discard Future`

* Return HTTP 400 on bad encoding in request

* Fix runnable example for getSocket

* Fix import to fix runnable examples

* Even more imports for the example

* Better self documenting runnable example

* Add missing import

* Import from module with correct signature

* Resolve port type mismatch
2021-01-14 20:17:02 +01:00
vabresto
65df5762a1
Add support for Transfer-Encoding: chunked (#16636)
* Add support for Transfer-Encoding: chunked

* Minor whitespace fixes

* Use recv instead of recvLineInto

* Undo changes to httpcore, inline changes
2021-01-10 11:42:23 +00:00
Dominik Picheta
4754806fb5
Fixes the asynchttpserver example some more (#16599)
I dislike this example a lot (busy looping for FDs to be closed is a very
poor waste of resources) but at least with these changes it's a little bit
better.
2021-01-07 08:39:56 +01:00
Timothee Cour
3b2f94810e
remove duplication in asynchttpserver examples (#16586)
* remove duplication in asynchttpserver examples

* fixup

* add comment showing how to run snippet locally
2021-01-05 17:21:06 +01:00
Miran
d2f4f25b56
fix #16506 by changing the example (#16580)
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2021-01-04 12:46:36 -08:00
Andreas Rumpf
122f22d163
asynchttpserver cleanups [backport:1.0] (#15966)
* asynchttpserver cleanups [backport:1.0]
2020-11-15 07:27:13 +01:00
Araq
02f8b11a71 fixes the doc rendering 2020-11-13 17:16:00 +01:00
Araq
9f566881f1 ported to FreeRTOS 2020-11-13 17:03:07 +01:00
Araq
cb19dc53ca better documentation 2020-11-13 13:07:48 +01:00
Araq
8778d4a6f3 attempt to make asynchttpserver better; fixes #15925; [backport:1.0] 2020-11-13 13:03:14 +01:00
flywind
4fe56b56ce
more clear (#15812) 2020-11-02 13:01:19 +01:00
Zed
ea761419ad
Fix asynchttpserver newline breaking content-length (#14565) [backport] 2020-06-06 12:20:11 +02:00
supakeen
09ca19208f
Add isNil check to custom Content-Length. (#13867) [backport:1.2]
Related to #13866.
2020-04-05 09:02:30 +02:00
flywind
6b9ffc7fad
fix asynchttpserver content-length header (#13846) 2020-04-03 09:05:43 +02:00
Timothee Cour
6e0c06f50e
fix #13218: avoid some irrelevant warnings for nim doc,rst2html,--app:lib, + other fixes (#13550)
* fix #13218: avoid some irrelevant warnings for nim doc,rst2html
* suppress warnRedefinitionOfLabel for nim doc
* lots of fixes for UnusedImport warnings
2020-03-13 20:42:41 +01:00
Dominik Picheta
ec8a17cc86 Revert broken asynchttpserver FutureStream additions.
As discussed in #13394, these changes cannot work. Reverted via

```
git revert --no-commit 5bf571f061
git revert --no-commit abd660c407
git revert --no-commit 955465e5f4
git commit
```
2020-03-06 11:52:30 +01:00
Henrique Dias
5bf571f061
Fix to asynchttpserver form data/body broken with #13147 (#13394)
* Fix to asynchttpserver form data/body broken with #13147
* New implementation that use a interator instance of future streams
* asynchttpserver now can handle chunks of data.
2020-02-14 21:59:37 +01:00
Henrique Dias
abd660c407
Added a basic example how to handle a Post request. (#13339)
* Added a basic example how to handle a Post request.

They were also made minor cosmetic changes.

* Minor fixes suggested by Yardanico

* Fixed a wrong value in chunkSize constant.

* Re-added the request.body for compatibility!
2020-02-07 03:59:28 -05:00
Henrique Dias
955465e5f4
Option to allow the request body to be processed outside the asynchttpserver library. (#13147)
Allow the request body to be processed outside the asynchttpserver library to break big files into chunks of data. This change does not break anything.
2020-02-04 21:13:25 +01:00
Andreas Rumpf
68ce808db1 minor optimization for asynchttpserver.nim 2019-10-04 09:48:45 +02:00
narimiran
aa513d78e7 [backport] run nimpretty on async 2019-09-30 13:57:58 +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
Araq
5abe880469 last stdlib cleanups 2019-09-21 06:43:37 +02:00
Zed
3b4952da94 Fix header inconsistencies in documentation (#11071) 2019-04-23 08:40:20 +02:00
Miran
bba3a20e7c documentation style tweaks (#10790)
* exports are the least important field in the docs:
  they are put in the last place (at the bottom)
* indent text after proc/type declaration for an easier navigation
  (noticeable difference between declarations and examples)
* quickfix invalid style in `asynchttpserver`
2019-03-08 13:55:26 +01:00
LemonBoy
bcb5995ddf Fix regression w/ keep-alive connections to AsyncHttpServer
We should keep listening if the connection is marked as keep-alive.

Fixes #10536
2019-02-04 22:16:55 +00:00
LemonBoy
59574b89a6 Clean up some code using a tuple unpack expression 2019-02-04 22:16:55 +00:00
Dominik Picheta
e3cee541bd Fixes long-standing asynchttpserver regression. (#10102) 2018-12-27 22:26:48 +01:00
hlaaf
c2aec1b6c1 Change parseEnum to something faster for method parsing in asynchttpserver (#7682)
* Add faster method parsing to asynchttpserver

* Make it readable

* Align case statement
2018-06-08 21:34:19 +01:00
Araq
bbb0fd4eb7 remove deprecated stuff from the stdlib; introduce better deprecation warnings 2018-05-05 21:45:07 +02:00
Dominik Picheta
a372363190 Don't catch-all in asynchttpserver. It hides bugs. 2017-11-26 16:40:24 +00:00
Andreas Rumpf
c474fdea16 further hardening of asynchttpserver 2017-11-19 03:05:55 +01:00
Dominik Picheta
fd350de580 Fixes #6386. (#6545) 2017-11-19 02:55:03 +01:00
superfunc
bca3bedc47 Handle failed uri parsing in asynchttpserver (#6374) 2017-09-15 10:41:12 +02:00
Artem Labazin
bcdc5ddd37 Add more suitable error code and reason phrase for required Content-Length request. 2017-07-26 02:02:24 +03:00
wt
622b4a7b47 Update asynchttpserver.nim 2017-06-06 08:52:19 +08:00
wt
7e7699a856 Fix bad tail for status response 2017-06-05 10:52:23 +08:00
Andreas Rumpf
159643824b fixes #3847 (#5609) 2017-03-27 09:39:46 +02:00
Dominik Picheta
37abcf18f8 Merge pull request #5466 from yglukhov/asynchttpserver-bad-content-length
Dont assert on malformed requests
2017-03-01 19:14:02 +00:00
Yuriy Glukhov
f842f9d6aa Dont assert on malformed requests 2017-03-01 17:11:39 +02:00
Yuriy Glukhov
28a7c874b7 Revert "Listen on ipv6" (#5461) 2017-03-01 15:03:10 +01:00
Yuriy Glukhov
d878c4c1b4 Listen on ipv6 2017-02-25 02:20:16 +02:00
Luke Diamand
de7f42a741 asynchttpserver: import json in the example code
The example code won't compile unless json is imported, because
of the use of the %* operator. This can trip-up inexperienced
Nim developers.
2017-01-10 20:39:29 +00:00