Skip to content

Conversation

@clamprecht
Copy link

The indextank python client is sending its HTTP GET requests with the full URL, instead of just the path & query part. For example, calling list_indexes() would send this HTTP request:

GET http://aeou.api.indextank.com/v1/indexes HTTP/1.1
[HTTP headers here...]

Instead of just:

GET /v1/indexes HTTP/1.1

This patch fixes this by passing empty string for the scheme and netloc parameters to urlunsplit. The current code seems to work with the production indextank server, maybe because nginx is handling the extraneous "http://..." part. But when testing the REST API locally with django "runserver" mode, it was just causing 404s for every request.

…request is just "GET /v1/..." rather than "GET http://api.indextank.com/v1...".  This makes the python client work while testing against the REST API in django "runserver" mode.
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

Successfully merging this pull request may close these issues.

1 participant