Commit Graph

56 Commits

Author SHA1 Message Date
Timothee Cour
0fcf1af765 uri: document removeDotSegments, add tests, show failure modes (#17064)
* uri: document removeDotSegments, add tests, show failure modes
* address comments
2021-02-20 17:58:54 +01:00
Benoit Favre
8f54d3b792 Fix bug in removeDotSegments when path ends with dot (#17038) [backport:1.2] 2021-02-15 11:33:26 +01:00
flywind
ceab5e49f2 uri module uses runnableExamples (#16982) 2021-02-09 13:07:51 +01: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
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
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
1aaa67fc18 [docs minor] remove unicode in docs comments (#16267) 2020-12-06 05:51:29 +01:00
flywind
139075e965 move decode_helpers to std/private (#16209) 2020-12-02 10:30:55 -08:00
flywind
cbc793b30b move tests to testament (#16101)
* move tests to testament

* minor

* fix random

* disable test random
2020-11-24 19:06:41 +01:00
flywind
af9cc2882f use func in uri module (#15486) 2020-10-05 17:04:08 +02:00
flywind
e85c5ad379 fix #15333 (#15336) 2020-09-24 08:54:13 +02:00
Miran
c62513049c fix #14082, don't crash on incorrectly formatted input (#14977) [backport]
* fix #14082, don't crash on incorrectly formatted input

* address code review

* remove duplication
2020-07-17 10:59:53 +02:00
hlaaftana
fbc97e712a move since from inclrtl to std/private/since (#14188)
* move since from inclrtl to std/private/since
* move since import in system below for HCR
2020-05-02 23:51:59 +02:00
Juan Carlos
c269964860 Add Data URI Base64, implements RFC-2397 (#13759)
* Add Data URI Base64, implements RFC-2397

* Add Data URI Base64, implements RFC-2397

* Add Data URI Base64, implements RFC-2397

* https://github.com/nim-lang/Nim/pull/13759#issuecomment-611498420

* https://github.com/nim-lang/Nim/pull/13759#issuecomment-611498420

* ReSync changelog

* https://github.com/nim-lang/Nim/pull/13759#issuecomment-611498420

Co-authored-by: Dominik Picheta <dominikpicheta@googlemail.com>
2020-04-13 14:15:45 +01:00
narimiran
0ca9cc7419 [backport] run nimpretty on web stuff 2019-09-30 13:58:11 +02:00
Timothee Cour
8c93c692b9 run runnableExamples in the module scope (#11732) [feature] 2019-07-22 16:22:57 +02:00
Araq
c94647aeca styleCheck: make the compiler and large parts of the stdlib compatible with --styleCheck:error 2019-07-10 12:42:41 +02:00
LemonBoy
ec26bc472d Add encodeQuery and ? to Uri module 2019-01-31 13:47:51 +01:00
Thomas T. Jarløv
91b39f2219 uri: Update documentation typo (#10471) 2019-01-27 21:59:58 +01:00
narimiran
83caa58c7a docs: fix trailing comma in links 2019-01-25 09:43:47 +01:00
Thomas T. Jarløv
bfeade9791 better docs: uri (#10373) 2019-01-19 15:31:14 +01:00
Miran
214f48eae9 Remove long deprecated stuff (#10332) 2019-01-18 07:18:32 +01:00
Kaushal Modi
903886396d Don't prevent ',' from getting escaped in theindex.html
- Enable escaping of links in theindex.html
- Fixes https://github.com/nim-lang/Nim/issues/9107.
- Second part of the fix for https://github.com/nim-lang/Nim/issues/9097.
2018-09-28 15:39:22 -04:00
Araq
bbb0fd4eb7 remove deprecated stuff from the stdlib; introduce better deprecation warnings 2018-05-05 21:45:07 +02:00
Dominik Picheta
9099ec5d0b Merges #7700 manually and adds decodePlus option to decodeUrl too. 2018-05-03 15:18:19 +01:00
Andreas Rumpf
f4c21305a9 uri.nim: don't rely on zero termination 2018-04-29 01:46:40 +02:00
Dominik Picheta
6c035379fe Merge pull request #6597 from pgkos/uri-allow-no-authority
Allow parsing URIs without authority
2018-01-28 17:00:33 +00:00
Veladus
27ea1750e5 Moved encodeUrl and decodeUrl from cgi to url 2017-11-25 16:55:10 +01:00
Federico Ceratto
bd71d4205b Make Uri rendering more lenient
When the hostname and path fields are set, handle missing or extra
slashes to generate valid URLs.
2017-11-14 02:28:13 +00:00
Andreas Rumpf
6a3288a60e more replacements for the deprecated '<' 2017-10-29 08:55:30 +01:00
pgkos
a20326e268 Allow parsing URIs without authority 2017-10-25 18:54:34 +02:00
Dominik Picheta
1dc6caea6b Fixes issues with URI concatenation when URI has no path. 2017-10-13 20:10:54 +01:00
Andreas Rumpf
a3f80c4bdf avoid deprecated procs 2017-07-26 08:52:03 +02:00
Arne Döring
000b8afd26 Remove expr/stmt (#5857) 2017-07-25 09:28:23 +02:00
Ruslan Mustakov
ecf278c467 Implement dial, support IPv6 in httpclient (#5763)
* Implement dial, support IPv6 in httpclient

Added ``dial`` procedure to networking modules: ``net``, ``asyncdispatch``,
``asyncnet``. It merges socket creation, address resolution, and connection
into single step. When using ``dial``, you don't have to worry about
IPv4 vs IPv6 problem.

Fixed addrInfo loop in connect to behave properly.
Previously it would stop on first non-immediate failure, instead of
continuing and trying the remaining addresses.

Fixed newAsyncNativeSocket to raise proper error if socket creation
fails.

Fixes: #3811

* Check domain during connect() only on non-Windows

This is how it was in the previous implementation of connect().

* Call 'osLastError' before 'close' in net.dial

* Record osLastError before freeAddrInfo in net.dial

* Add missing docs for 'dial' proc

* Optimize dial to create one FD per domain, add tests

And make async IPv6 servers work on Windows.

* Add IPv6 test to uri module

* Fix getAddrString error handling
2017-05-02 09:25:50 +02:00
enthus1ast
f2ce8eb372 more isAbsolute tests for uri.nim
Signed-off-by: enthus1ast <enthus1ast>
2017-01-21 02:54:38 +01:00
enthus1ast
46ac235715 added protocol-relative test to uri.nim
Signed-off-by: enthus1ast <enthus1ast>
2017-01-21 02:40:09 +01:00
enthus1ast
9626919cd3 added isAbsolute to uri.nim 2017-01-20 00:45:44 +01:00
Dominik Picheta
b2b2dcff08 Fixes #4959. 2016-10-26 21:26:48 +02:00
CORDEA
f77bc7d93a Fixed an wrong example of the doc 2016-03-02 20:55:02 +09:00
Dominik Picheta
d8a10457e2 Fixes #3207. 2015-09-28 23:04:17 +01:00
Dominik Picheta
193f248ea0 Fixes parsing of URIs that begin with '//'. 2015-08-23 18:22:37 +01:00
def
650a75beea Make uri module usable for faster URI parsing:
- A version of parseUri that takes a uri as parameter and modifies it
- Export initUri so you can use the new parseUri better
- Avoid creating new strings
2015-03-17 19:39:02 +01:00
Dominik Picheta
bab8190b67 Fixes bugs introduced by ee62d56cad. Closes #2227. 2015-03-05 21:18:28 +00:00
Stephan Diehl
aa62dcc2af little documentation fix on conbine and / 2015-02-21 21:53:19 +01:00
def
e686ca2523 Fix a few more warnings 2015-02-17 02:22:30 +01:00
Guillaume Gelin
3119fe087d Happy new year! 2015-01-06 15:26:33 +01:00
def
76dbce275a Fix (u: Uri), add test cases and make it work for opaque URIs 2015-01-03 17:23:13 +01:00
Dominik Picheta
c0207dbae2 More deprecation warning fixes (asyncdispatch, uri). 2014-12-26 16:56:19 +00:00
Dominik Picheta
342ed97eed Fix some deprecation warnings in the uri module. 2014-12-26 16:30:37 +00:00