Tuesday, 27 October 2020

HTTP response 403. Is the problem with my Apache config or my Python enoding of the URL?

When I access

http://my_site.com/api/my_project/submitSearch.php?skills=C+OR+%28C%2B%2B+AND+UML%29

I get an HTTP response of 403.

The point being that I am encoding skill=C OR (C++ AND UML) in Python using urllib.parse.quote_plus().

If I use skill=(C++ AND UML), then there is no problem.

http://my_site.com/api/my_project/submitSearch.php?skills=%28C%2B%2B+AND+UML%29

I can only assume that the URL is triggering some Apache config rule. I asked my ISP and their solution was to allow all access from my current IP address. BUT, I want to allow everyone to access this URL, so how can I configure my Apache to allow this?

OR, am I wrongly encoding my URL in Python? Strangely, when I use encodeURIComponent() in JavaScript, the server does not reject the request.

So, the JS/Python encodings are

Python: http://localhost/api/enigma/submitSearch.php?skills=C+OR+%28C%2B%2B+AND+UML%29

JS:        http://localhost/api/enigma/submitSearch.php?skills=C%20OR%20(C%2B%2B%20AND%20UML)

Also, the problem is only at my ISP, not on localhost



from HTTP response 403. Is the problem with my Apache config or my Python enoding of the URL?

No comments:

Post a Comment