Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LOAD does not handle correctly URLs containing encoded delimiters #2011

Closed
Siskin-Bot opened this issue Feb 15, 2020 · 2 comments
Closed

LOAD does not handle correctly URLs containing encoded delimiters #2011

Siskin-Bot opened this issue Feb 15, 2020 · 2 comments

Comments

@Siskin-Bot
Copy link
Collaborator

Submitted by: Ladislav

Encoded delimiter characters are not delimiters in URLs. LOAD "disrespects" this property "unencoding" such characters and transforming them to delimiters, in fact.

mold load "http://a.b.c/d?e=f%26&g=h"
; == "http://a.b.c/d?e=f&&g=h"
; "http://a.b.c/d?e=f%26&g=h" expected!

Imported from: CureCode [ Version: r3 master Type: Bug Platform: All Category: Datatype Reproduce: Always Fixed-in:none ]
Imported from: metaeducation#2011

Comments:

Rebolbot commented on Apr 4, 2013:

Submitted by: BrianH

This is related to #1327, #1333 and #1644.


Rebolbot commented on Sep 19, 2013:

Submitted by: Ladislav

In the core-tests suite.


Rebolbot mentioned this issue on Jan 12, 2016:
Internal representation of URLs


Rebolbot added Type.bug, Status.important, Test.written on Jan 12, 2016


@Oldes
Copy link
Owner

Oldes commented Apr 13, 2022

Related to: #2012

@Oldes
Copy link
Owner

Oldes commented Apr 14, 2022

It should be noted, that there are 2 escaping:

  1. Rebol url in source code escaping (required to escape Rebol delimiter chars which are allowed in url as ;[](){}")
  2. RFC's url escaping

Unfortunately both of them are using % as an escape char.

So it may be strange, but it is correct. One must be careful when using url-encoded data in urls inside a Rebol source code.

>> #[url! "http://a.b.c/d?e=f%26&g=h"]
== http://a.b.c/d?e=f%2526&g=h

>> join http://a.b.c/d? "e=f%26&g=h"
== http://a.b.c/d?e=f%2526&g=h

>> length? probe #[url! "a:%26"]
a:%2526
== 5 ;<--- because in construction syntax the string is not decoded

>> length? probe a:%26
a:&
== 3 ;<--- because Rebol lexer decoded the & char

To have load respecting the escaping, we would first need to allow lexer's delimiter chars be part of the url syntax
(for example: http://example.com/?data=a;b)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants