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

Incorrect escape of url #2

Open
Rob--W opened this issue Jan 2, 2013 · 7 comments
Open

Incorrect escape of url #2

Rob--W opened this issue Jan 2, 2013 · 7 comments

Comments

@Rob--W
Copy link

Rob--W commented Jan 2, 2013

The URL is incorrectly escaped: ? becomes %3F:

http://whateverorigin.org/get?url=http%3A%2F%2Fwww.google.com%2Fsearch%3Fq%3DFoo%2520bar&callback=x
http://whateverorigin.org/get?url=http://www.google.com/search?q=Foo+bar&callback=x

Actual result (status key) for the first URL:

{
    "url": "http://www.google.com/search%3Fq=Foo%2520bar",
    "content_type": "text/html; charset=UTF-8",
    "http_code": 404
}

Expected result:

{
    "url": "http://www.google.com/search?q=Foo%20bar",
    "content_type": "text/html; charset=UTF-8",
    "http_code": 200
}
@ripper234
Copy link
Owner

Thanks, I'll try to take a look during the weekend.

@Rob--W
Copy link
Author

Rob--W commented Jan 5, 2013

I decided to create an own CORS-enabled (reverse) proxy using NodeJS, and also host it on Heroku. Heroku is awesome :)

@ripper234
Copy link
Owner

This is nice, but too bad you decided to do this instead of pushing a patch to this project or submit another issue.
I get the "node.js is cool, let's build something" approach, and it's perfectly fine.

However, a big part of open source is collaboration, not just running around to open a new project just so you can be cool.

(Caveat: I've never actually successfully submitted patches to an OSS project, even though I tried ... all I've done is run around opening new projects :))

Anyway, if you could submit a pull request to WhatEverOrigin that adds COR support, that would be super cool. I'd do it myself but I'm a bit swamped with work right now. I understand it might take you some time to learn how to use play (although it's really rather simple and well documented). I opened an issue for now, might get to it soon/later. In any case, thanks for updating here!

@Rob--W
Copy link
Author

Rob--W commented Jan 5, 2013

I'm not gifted with infinite time either, so I just left a comment with the language-agnostic implementation details. Including a response header should not be that hard, so I'll leave it up to you.

@ripper234
Copy link
Owner

Thanks, I'll do that.
Didn't mean to criticize too harshly, and I'm all for learning by creating.
Peace out.

@bjesus
Copy link

bjesus commented Mar 13, 2014

Was this ever fixed? I'm trying to fetch a google cache page[0], but it seems WhateverOrigin fails to escape the URL as it should.

Am I doing something wrong?

[0] http://webcache.googleusercontent.com/search?q=cache:news.ycombinator.com

@ripper234
Copy link
Owner

I'm actually not sure, it's been a while back. Sadly I don't have the time to look into it ... but pull requests are welcome!

AstroCB added a commit to AstroCB/Whatever-Origin that referenced this issue Apr 19, 2015
Bring back fixes introduced in commit 8ed8c6b.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants