Commit Graph

4894 Commits

Author SHA1 Message Date
Joey
bfcb7c1621 DELETE requests should always have a content-length header (#16618)
* 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
2021-01-08 18:48:23 +00:00
konsumlamm
a4257dc3b6 Improve documentation for the md5 module (#16631) 2021-01-07 20:57:11 +01:00
flywind
89a21e4ec7 oids: switch from PRNG to random module (#16203)
* switch from PRNG to random module
* fix the regression
* comments + tests
* runnableExamples
* make oids better
2021-01-07 09:38:31 +01:00
flywind
bab0aa6ecf add math.signbit (#16592) 2021-01-07 08:48:02 +01: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
konsumlamm
d34d023da1 Minor docs/format changes (cpuinfo, volatile) (#16602) 2021-01-06 20:29:22 +01:00
konsumlamm
8a3b6190c3 Improve documentation for deques (#16589) 2021-01-06 20:16:26 +01:00
konsumlamm
2c2baa9fad Link the <fenv.h> header (#16597) 2021-01-05 20:51:51 +01:00
flywind
c04f305bf7 make cstrutils work in VM (#16590)
* make cstrutils work in VM

* more
2021-01-05 17:52:26 +01:00
konsumlamm
0c4bd65e8d Improve documentation for complex (#16588)
* Improve documentation for complex

Add missing doc comments

* Add runnableExample

Add links for principal values
Optimize `-`
Change var to let

* Use std prefix for imports
2021-01-05 17:50:15 +01:00
flywind
df9e74b510 fix #9125 (#16582)
* fix #9125

* Update tests/stdlib/tmath.nim

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>

* back

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
2021-01-05 17:47:10 +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
Neelesh Chandola
0d67ad0bf3 Add backwards index overload for [] for JsonNode (#16501)
* Add backwards index overload for `[]` for JsonNode

* Add since

Co-authored-by: flywind <43030857+xflywind@users.noreply.github.com>

* Add docs, example, and changelog

Co-authored-by: flywind <43030857+xflywind@users.noreply.github.com>
2021-01-04 17:46:39 +01:00
konsumlamm
435f829348 Improve sequtils documentation (#16559)
* Improve sequtils documentation

Uncomment assertions in tests

* Use present tense
2021-01-04 11:04:30 +01:00
konsumlamm
763fef59fa Improve documentation for critbits (#16568) 2021-01-03 22:25:05 -08:00
hlaaftana
2aed418698 Fix #16554 (#16564) 2021-01-03 08:02:12 +01:00
konsumlamm
2eccef7ad6 Algorithm improvements (#16529)
* Improve documentation for algorithm

Remove unused import in algorithm tests
Improve formatting

* Reapply fix for reverse on empty openArray

* Use 3rd person singular

Add more explanations.
2021-01-02 20:28:59 +01:00
flywind
e869767aa7 fix #16061 (#16551) 2021-01-02 17:13:01 +01:00
flywind
d8b1ffc857 fix #16542 (#16549)
* fix #16542
2021-01-02 14:32:37 +01:00
Juan Carlos
1d2e2b5a5b Add mimetypes.mimesLongest (#16480)
* Allow single alloc mimetypes ops

* Allow single alloc mimetypes ops

* Update lib/pure/mimetypes.nim

Co-authored-by: flywind <43030857+xflywind@users.noreply.github.com>

* https://github.com/nim-lang/Nim/pull/16480#issuecomment-752630190

* https://github.com/nim-lang/Nim/pull/16480#issuecomment-752630190

* https://github.com/nim-lang/Nim/pull/16480#issuecomment-753349661

* update changelog

Co-authored-by: flywind <43030857+xflywind@users.noreply.github.com>
2021-01-02 08:10:38 +01:00
Juan Carlos
505d04389a Documentation only Testament unittest (#16532)
* Link Testament from unittest doc

* Update lib/pure/unittest.nim

Co-authored-by: flywind <43030857+xflywind@users.noreply.github.com>

Co-authored-by: flywind <43030857+xflywind@users.noreply.github.com>
2021-01-01 19:44:06 +01:00
n5m
b254d91cd0 reuse const (#16422) 2021-01-01 19:41:49 +01:00
flywind
d069c08d2b follow up #16399 clean up docs (#16539)
* follow up #16399 clean up docs

* more
2021-01-01 19:39:05 +01:00
n5m
5953fbd834 link to POSIX sendSignal from osproc.kill docs (#16475)
and from osproc.terminate docs
2021-01-01 19:01:45 +01:00
flywind
5fb56a3b2c refactor cmpIgnoreStyle and cmpIgnoreCase (#16399)
* init

* support strutils

* more

* better

* Call len once per string/cstring

* Change var to let

* Compare ternary on first char

* More appropriate param name

* fix

* better

* one test

* impl

* more efficient

* minor

Co-authored-by: Clyybber <darkmine956@gmail.com>
2020-12-31 11:54:40 +01:00
rockcavera
876fa3e62e adding missing commas in std/bitops (#16520)
adding missing commas between the importc and header pragmas of some procs.
2020-12-30 16:41:25 -08:00
flywind
805917768d use runnableExamples in options (#16503) 2020-12-30 16:26:49 +01:00
flywind
515cd45420 Add math.copySign (#16406)
* add math.copySign
* fix + tests
2020-12-30 15:09:30 +01:00
flywind
e718a4a058 follow #15860 clean cgi module (#16487)
* follow #15860  clean cgi module

* follow #15860  clean cgi module
2020-12-27 19:46:21 +01:00
Juan Carlos
0c8ce2dccf Save some alloc on base64 using encodeSize (#16465) 2020-12-27 12:02:10 +01:00
flywind
689504081f follow #15357 and move decodeQuery (#15860)
* follow #15357 and move decodeQuery
* solve problem one
* minor
* deprecate decodeData
* add changelog and since
* add testcase for decodeQuery
2020-12-27 11:59:32 +01:00
flywind
1d615dfda7 fix #16474 unittest.check type1 is type2 gives CT error (#16476)
* fix #16474
* more tests
2020-12-27 09:16:53 +01:00
Juan Carlos
a29bbeee41 Add missing HTTP codes (#16454) 2020-12-23 12:26:37 -08:00
flywind
b1c3dab208 add euclDiv and euclMod to math (#16414)
* add `euclDiv` and `euclMod` to `math`
* use abs
* Update lib/pure/math.nim

Co-authored-by: Clyybber <darkmine956@gmail.com>
2020-12-23 12:04:38 +01:00
flywind
417c2509c4 strip minor improvement (#16444)
* strip minor improvement
* add more tests
* Update tests/stdlib/tstrutils.nim

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
2020-12-23 11:57:48 +01:00
Timothee Cour
bc84d9c8cb [backport => 1.0] fix #16428 vmops now works for generic procs (#16429)
* fix #16428 vmops now works for generic procs

* remove duplication
2020-12-22 02:05:21 +01:00
ee7
297c8e403d styleCheck: Fix some inconsistent identifiers (#16177) 2020-12-21 09:41:56 -08:00
flywind
d00a412129 docs minor for math (#16407) 2020-12-20 19:53:27 -08:00
Peter Salvi
051477b314 O(1) concatenation of singly- and doubly linked lists. (#16362)
* O(1) concatenation of singly- and doubly linked lists.

There is also new `toSinglyLinkedList` and `toDoublyLinkedList`
functions for conversion from `openArray`s, similarly
to `toHashSet` or `toTable`.

* Add `sequtils` import to runnable examples with `toSeq`.

* Added missing call to runnable examples.

* Add .since annotation, changelog, and tests.

* Rename `lists.concat` as an overload to `lists.append`.

* Renamed `append` to `add` in lists.

* Remove faulty `add` for `DoublyLinkedList`s.

* Improved tests for lists.

* `lists.add` moves the second list; added `lists.copy` for shallow copy.

* More tests for `lists.add` and `lists.copy`.

* More compact tests for lists with templates.

* List concatenation with copying (`add`) and moving (tentatively `addMove`)

* Renamed `addMove` to `addMoved`; renamed arguments according to the style guide.

* Added extended example to `lists.copy`.

* Corrected .since annotations to 1.6

* Add .since annotation, changelog, and tests.

* Rename `lists.concat` as an overload to `lists.append`.

* Renamed `append` to `add` in lists.

* Remove faulty `add` for `DoublyLinkedList`s.

* `lists.add` moves the second list; added `lists.copy` for shallow copy.

* More tests for `lists.add` and `lists.copy`.

* List concatenation with copying (`add`) and moving (tentatively `addMove`)

* Renamed `addMove` to `addMoved`; renamed arguments according to the style guide.

* Since declarations changed to (1,5,1).

* Add .since annotation, changelog, and tests.

* Rename `lists.concat` as an overload to `lists.append`.

* Renamed `append` to `add` in lists.

* Remove faulty `add` for `DoublyLinkedList`s.

* `lists.add` moves the second list; added `lists.copy` for shallow copy.

* More tests for `lists.add` and `lists.copy`.

* List concatenation with copying (`add`) and moving (tentatively `addMove`)

* Renamed `addMove` to `addMoved`; renamed arguments according to the style guide.

* Changelog update.

* Fix rebasing errors.

* Self-adding with `lists.addMove` results in a cycle now.
Added some extra tests.
2020-12-20 13:09:35 +01:00
Tomohiro
dcdbae798c Fix osproc so that it doesn't close pipe/process/thread handles twice (#16385) [backport]
* Add error check to closeHandle and fix closing handle twice in osproc

* Fix compile error on Linux
2020-12-18 10:17:19 +01:00
flywind
e1e069dd6c use hexchar in stdlib (#16290) 2020-12-17 13:41:05 +01:00
flywind
8cd3655dee make the docs of strutils a bit better (#16368) 2020-12-17 13:37:32 +01:00
Andreas Rumpf
b87bcb6d92 fixes #16359 [backport] (#16377) 2020-12-17 13:35:02 +01:00
ee7
38eb021f81 sequtils.nim: Change some func back to proc (#16309)
This commit changes the funcs that take a `proc` parameter back to
procs.

This reverts some of commit 6f57ebae34:
  sequtils.nim: Use `func` (#16293)

See also:
- https://github.com/nim-lang/Nim/issues/16303
- https://github.com/nim-lang/Nim/pull/16304
2020-12-14 20:14:49 +01:00
Elliot Waite
f3d57761ab Fix broken links in docs (#16336)
* Fix broken links in docs

* Fix rand HSlice links
2020-12-14 20:13:12 +01:00
flywind
8f6e07a9a2 clean the docs of sequtils (#16332) 2020-12-14 16:38:02 +01:00
Jason Beetham
5a58440ebe Added strscans.scanTuple (#16300)
* Added since and changelog
2020-12-12 23:29:20 +01:00
Timothee Cour
b1c232aca1 improve tests for collections (#16328)
* improve tests for collections

* remove remaining code blocks in deques.nim

* improve runnableExamples
2020-12-12 09:33:29 +01:00
Timothee Cour
0b73106ccf add math.isNaN (#16179)
* add math.isNaN
* isNaN now works with --passc:-ffast-math; tests
* Update lib/pure/math.nim

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2020-12-11 11:01:43 +01:00