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

It is impossible to read/write url! s with some special characters #2207

Open
rebolbot opened this issue Mar 23, 2015 · 1 comment
Open

It is impossible to read/write url! s with some special characters #2207

rebolbot opened this issue Mar 23, 2015 · 1 comment

Comments

@rebolbot
Copy link
Collaborator

Submitted by: IngoHohmann

URL!s with "#" "@" ":" can not be read, because they are not url-encoded / interpreted incorrectly.

Furthermore, when trying to url-encode it by hand, the "%" will be url-encoded again in the url, rendering it incorrect again.

URL-encoding:

    >> url: http://test/abc/#def/ghi
    == http://test/abc/#def/ghi

If I do it manually, the "%" gets encoded, though:

    >> replace url "#" "%23"
    == http://test/abc/%2523def/ghi

"@" and ":"

    >> read  http://localhost:8008/@xxx:localhost
    ** Access error: cannot connect: tcp://xxx:80 reason: 0
    ** Where: open open unless sync-op either read
    ** Near: open conn port

"#" as part of the url:

    >> write http://localhost:8008/_matrix/client/api/v1/join/#test2:localhost?access_token=shortened ""
    ** Access error: protocol error: "Server error: HTTP/1.0 403 Forbidden"

Testing the same using curl:

    $ curl -XPOST "http://localhost:8008/_matrix/client/api/v1/join/#test2:localhost?access_token=shortened" -d ""
    {"errcode":"M_FORBIDDEN","error":"Missing access token."}⏎           

My guess is that the url is cut at the "#", because of it special meaning in urls. So let's try to url-encode the "#":

    >> write http://localhost:8008/_matrix/client/api/v1/join/%23test2:localhost?access_token=shortened ""
    ** Access error: protocol error: "Server error: HTTP/1.0 403 Forbidden"

Testing again with curl:

    $ curl -XPOST "http://localhost:8008/_matrix/client/api/v1/join/%23test2:localhost?access_token=shortened" -d ""
    {"room_id":"!mLfKqJqpsJduuNgzDy:localhost"}⏎  

So the problem for Rebol seems to be that "#" is not url-encoded, but if I try to url-encode it, the "%" sign gets encoded, so the url is broken again. (As mentioned in the beginning).

CC - Data [ Version: r3 master Type: Bug Platform: All Category: Parse Reproduce: Always Fixed-in:none ]

@ladislav
Copy link
Contributor

I think that this is #2012 reformulated.

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