Commit Graph

8389 Commits

Author SHA1 Message Date
konsumlamm
bd5ce5b351 Improve documentation for stats (#16742)
* Improve documentation for stats

* Address nits

* Update lib/pure/stats.nim

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2021-01-19 08:40:09 +01:00
Timothee Cour
6c07b0a1f8 jsonutils.jsonTo: support opt (#16739) 2021-01-17 11:37:06 +01:00
konsumlamm
44ceefa9fe Improve documentation for packedsets (#16715)
* Improve documentation for packedsets

Add more runnableExamples
Add deprecated pragma to intsets
Replace intsets with packedsets in lib.rst

* Apply suggested changes
2021-01-16 16:09:53 +01:00
flywind
8939de15d7 minor improvement on math.nim (#16733) 2021-01-16 12:37:23 +01:00
Timothee Cour
18e14f5920 js: improve tests + some docs (#16727)
* js: improve tests

* _

* _

* _

* fixup
2021-01-16 12:08:40 +01:00
flywind
5ed6a94d8f promote math.isNaN (#16734) 2021-01-15 22:19:17 -08:00
Juan Carlos
78a99587a4 Deprecate TaintedString (#15423)
Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
Co-authored-by: Dominik Picheta <dominikpicheta@googlemail.com>
2021-01-15 18:56:38 -08:00
konsumlamm
7b632f9ccb Improve documentation for the hashes module (#16720)
* Improve documentation for hashes

* Fix runnableExamples

* Apply suggestions
2021-01-15 22:42:01 +00:00
Timothee Cour
52cf728001 followup for #16717: minimized example + improved comment (#16721) 2021-01-15 01:09:58 +01:00
Juan Carlos
41965880ce Add js BigInts (#16409)
* Add BigInts
* Renames tos plurals
* Improve Stringifications
* Update changelog.md

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

* RunnableExamplerize
* discard the discardable pragma
* Several improvements from peer reviews, more docs
* More doc, more test
* More doc, more test
* Better error message 'Error: usage of low is an {.error.} defined at jsbigints.nim' instead of just 'type mismatch JsBigInt'
* is an overload, rename
* proc to scare kids away
* Update lib/js/jsbigints.nim

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

* https://github.com/nim-lang/Nim/pull/16409#discussion_r554365041

Co-authored-by: flywind <43030857+xflywind@users.noreply.github.com>
Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
2021-01-14 20:19:41 +01: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
flywind
ef9027c290 fix #16706 (#16717) [backport:1.4] 2021-01-14 16:52:00 +01:00
Yuriy Glukhov
4ae520711d Fixes #16436 (#16695)
* Fixes #16436

* Comments addressed
2021-01-14 08:53:21 +01:00
Timothee Cour
fee5fbc722 fix #16703; revert most of #16480; add tests/stdlib/tmimetypes.nim (#16711) 2021-01-13 14:52:59 -08:00
Yuriy Glukhov
165d39738d Check for errors after sendPendingSslData (#16696)
* Check for errors after sendPendingSslData

* Leftover comment removed
2021-01-13 15:09:28 +01:00
flywind
b727217229 refactor cmpNimIdentifier (#16611)
* refactor cmpNimIdentifier

* Apply suggestions from code review

Co-authored-by: Clyybber <darkmine956@gmail.com>

Co-authored-by: Clyybber <darkmine956@gmail.com>
2021-01-13 12:29:30 +01:00
Timothee Cour
61fd19c7e6 revive PR #16320 (CRLF fix); fix #16308; Update openssl.nim (#16648)
* Update openssl.nim

Fix issue # 16308

* Update openssl.nim

These are also related to Issues [#16308](https://github.com/nim-lang/Nim/issues/16308)

* Update openssl.nim

* Add files via upload

SSL PEM_read_RSAPUBKEY check

* Delete topenssl_rsa_private_key.pem
* Delete topenssl_rsa_public_key.pem
* Delete topenssl.nim
* Add files via upload
* Update topenssl.nim

This test makes me dizzy. Variables such as' PRSA 'must be declared in advance, otherwise they will run incorrectly. The argument uses a cString, and string also makes an error.

* Update topenssl.nim

```
lhf@lhf-pc:/media/lhf/D$ cat -e ./topenssl.nim
import std/wordwrap$
import openssl$
```

* Update topenssl.nim
* dos2unix tests/stdlib/topenssl.nim

Co-authored-by: lihaifeng <lihaifeng@wxm.com>
2021-01-12 20:11:30 +01:00
Mildred Ki'Lya
71db2be833 Improve uri.parseQuery to never raise an error (#16647)
In case of malformed query string where there is `=` on the value, handle
this character as part of the value instead of throwing an error.

The following query string should no longer crash a program:

    key=value&key2=x=1

It will be interpreted as [("key", "value"), ("key2", "x=1")]

This is correct according to latest WhatWG's HTML5 specification
recarding the urlencoded parser:
https://url.spec.whatwg.org/#concept-urlencoded-parser

Older behavior can be restored using the -d:nimLegacyParseQueryStrict
flag.
2021-01-12 13:42:05 +01:00
Yuriy Glukhov
e5ea3f0cce Compile sqlite3 with -O3 flag (#16697) 2021-01-12 13:26:52 +01:00
konsumlamm
bf184bcdd9 Remove longestMatch in _WithPrefix iterators (#16689) 2021-01-12 08:35:27 +01:00
Andrey Makarov
fd5c8ef208 RST: implement internal targets (#16614) 2021-01-11 19:51:04 +01:00
konsumlamm
5897ed9d3d Improve documentation of strmisc (#16665)
Simplify examples
2021-01-11 10:53:15 +01:00
Timothee Cour
f6c2450cdb fix #16555, fixes #16405: len, high honors '\0' for cstring in vm (#16610) 2021-01-11 10:16:20 +01:00
flywind
f82100ac93 fix broken CI (#16663) 2021-01-10 16:19:40 +00:00
Antonis Geralis
7bde6aa37f Httpclient improvements (#15919)
* 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>
2021-01-10 13:40:53 +00: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
konsumlamm
b7ff0b2a11 Use func in lenientops (#16641) 2021-01-09 00:24:41 +01:00
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
PMunch
0e7902b976 Implements streams for sockets (#15729) 2021-01-07 16:09:57 +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
inv2004
04b765c16d Jsonutils: pass opt for object in object (#16615)
* jsonutils: fromJson forward opt param fix

* jsonutils: object in object test + fix: opt pass
2021-01-07 03:09:02 +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
Timothee Cour
c21360e67a macros.quote: document hard to use op; add more useful examples (#16489)
* macros.quote: document hard to use `op`; add more useful examples

* add back doc comment removed in a60305fbf3

* address comment

* fixup

* clarify quoting rules

* Update lib/core/macros.nim

Co-authored-by: Clyybber <darkmine956@gmail.com>

Co-authored-by: Clyybber <darkmine956@gmail.com>
2021-01-06 19:28:17 +01:00
inv2004
0d5cab77f6 jsonutils: fromJson forward opt param fix (#16612) 2021-01-06 18:42:49 +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
flywind
fe20492f05 clean up the docs of some modules under lib/js (#16579) 2021-01-04 19:54:33 +01:00
Andreas Rumpf
6317e4004d make --gc:arc --exceptions:quirky work again [backport:1.4] (#16583)
* make --gc:arc --exceptions:quirky work again [backport:1.4]

* fixes #16404 [backport:1.4]
2021-01-04 19:44:50 +01:00
flywind
9531afac48 fix #16499 (#16514) 2021-01-04 18:27:58 +01: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
Juan Carlos
349574d574 Add posix_utils.osReleaseFile (#16452)
* Add posix_utils.osReleaseFile

* Update lib/posix/posix_utils.nim

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

* Update lib/posix/posix_utils.nim

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

* Add a basic sanity test

* Add a basic sanity test

* Add a basic sanity test

* Add a basic sanity test

* https://github.com/nim-lang/Nim/pull/16452#issuecomment-753364096

* Update lib/posix/posix_utils.nim

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>

* Update lib/posix/posix_utils.nim

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>

* Update changelog.md

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>

Co-authored-by: flywind <43030857+xflywind@users.noreply.github.com>
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2021-01-04 15:21:36 +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