Closed MarkDavidson closed 10 years ago
Hmmm, this is interesting. I would have thought the APPEND_SLASH
setting would be to blame, but it appears to be set correctly.
Here's some info about APPEND_SLASH
When set to True, if the request URL does not match any of the patterns in the URLconf and it doesn’t end in a slash, an HTTP redirect is issued to the same URL with a slash appended. Note that the redirect may cause any data submitted in a POST request to be lost.
Even if that feature was working, TAXII is all POSTs, so we can't have POST data going missing. Also, I think I'd like to keep redirects to a minimum (as a practice). IMO the right thing to do is just change urls.py to make the trailing slash optional.
I'll go ahead and make the change.
This was the right fix. Looking back at the original issue, the problem was that the original request (for /services/discovery
) WAS being redirected, but the client then was issuing a GET instead of a POST.
Note that the redirect may cause any data submitted in a POST request to be lost.
Making the slash optional in the url config allows either URL to work without a redirect.
Currently a path of
/services/discovery/
works, but/services/discovery
does not. I think this is an easy typo to make and therefore the trailing slash should be optional (e.g., both paths should resolve to the discovery service.)Note: This should also apply to the poll service and inbox services.