Skip to content

Query parameters don't work properly #20

Open
@GitBoudewijn

Description

@GitBoudewijn

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:

{
 "Error": "http://http%3A%2F%2Fexample.com is not a valid resource"
}

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 of encodeURIComponent()).

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions