mirror of
https://github.com/jlengrand/bugsink.git
synced 2026-03-10 08:01:17 +00:00
Document that api_catch_all disables APPEND_SLASH behavior for the api
See #188
This commit is contained in:
@@ -209,6 +209,13 @@ def download_file(request, checksum):
|
||||
|
||||
@csrf_exempt
|
||||
def api_catch_all(request, subpath):
|
||||
# This is a catch-all for unimplemented API endpoints. It logs the request details and raises a 404 (if
|
||||
# API_LOG_UNIMPLEMENTED_CALLS is set).
|
||||
|
||||
# the existance of this view (and the associated URL pattern) has the effect of `APPEND_SLASH=False` for our API
|
||||
# endpoints, which is a good thing: for API enpoints you generally don't want this kind of magic (explicit breakage
|
||||
# is desirable for APIs, and redirects don't even work for POST/PUT data)
|
||||
|
||||
if not get_settings().API_LOG_UNIMPLEMENTED_CALLS:
|
||||
raise Http404("Unimplemented API endpoint: /api/" + subpath)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user