-
Notifications
You must be signed in to change notification settings - Fork 32
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
Query parameters don't work properly #20
Comments
Hi, Thanks for your great service, I have a similar issue. For example I need to request
But the request url received by the server is And as @GitBoudewijn said, I can't make a request like
The API doesn't do |
At this point the server correctly understands the urls sent with encodeURIComponent() (at least i hope so) This is a valid request I think the problem is that when the server makes the request to the third party it does not reconstruct the new request building a complete URL by encoding individual parts. Fixing that would give a lot of power to the proxy api and that's something I'm not sure I want to happen. As it says on the landing page this is a CORS proxy to bypass same-origin policy related to AJAX requests to third party services allowing access resources from any website. You can use to prevent mixed content of images and JSON data proxying the resources to serve them under https. As of today there are about 5 million proxy requests per day. Last year peaks of 40 million were reached. Proyect is very nice but I don't want to spend all day checking that no one abuses. Unless you tell me otherwise i will change the label from bug to enhancement and then i will think about it. I am very thankful for the feedback |
Ok, I understand your idea, preventing abuse is a hard problem. I think it's fine to keep the existing logic. Thank you for your reply. |
Hi,
Thanks for your great service, but I've come across an issue:
Normally when you set query parameters in an url you use something like encodeURIComponent(), especially when you have another url as the value which can contain special characters like ?, = and &. However with your service when you do this:
var url = 'https://api.codetabs.com/v1/proxy/?quest=' + encodeURIComponent('http://example.com');
Requesting that url gives this response:
So apparently the server doesn't actually treat it as a query string. Either it has to decode the query string, or you could allow urls like 'https://api.codetabs.com/v1/proxy/http://example.com' (in which case you would use
encodeURI()
instead ofencodeURIComponent()
).The text was updated successfully, but these errors were encountered: