ripper234 / Whatever-Origin

An open source alternative to AnyOrigin.com (this project is looking for a maintainer)
http://whateverorigin.org/
321 stars 74 forks source link

Internal server error on requesting an unescaped URL #1

Closed Rob--W closed 12 years ago

Rob--W commented 12 years ago

Some characters in the request URI are causing trouble. I first noticed the bug on the space character. Using %20 or + yields the same error. Upon further investigation, I've found many other characters which break the service:

Examples:

The current method to get it to work is to escape the URL twice:

var actualrequest = 'http://example.com/" test+%';
var jsonp_request = 'http://whateverorigin.org/get?url=' + encodeURIComponent(encodeURI(actualrequest));

This looks awkward. encodeURI should not be needed.

ripper234 commented 12 years ago

Thanks for reporting, I'll take a look later this week / weekend.

ripper234 commented 12 years ago

Fixed, added a call to UriEncoder.encode.

Rob--W commented 11 years ago

Encoding the URL again is not a solution.

It appears that Play was bugged at the time of reporting this issue. The relevant report can be found here: https://play.lighthouseapp.com/projects/82401-play-20/tickets/285. Can you revert [this commit]()https://github.com/ripper234/Whatever-Origin/commit/e98331e3af2fac1e450c299df2d85b8443bc9697, and test again using the URLs I provided in the first post?

I guess that reverting the commit also fixes #2,

Let me know when you've deployed it.

PS. I ran across this page, you might like it: http://playcheatsheet.appspot.com/show/ArtemMedeu/armed/play-cheatsheets

ripper234 commented 11 years ago

Sorry, busy time - I don't have the time right now to test this, and I don't want to push it without testing. Could you test it out and send out a pull request?

I'm not sure the bug you linked to is relevant, it is in Play 2, and I'm using Play 1 (entirely different codebase).

skeeto commented 10 years ago

Rob--W is correct. This issue is originally a bug in Play. e98331e introduces an encoding bug in WhateverOrigin, leading to #2. I'm now having problems with it as well.