Django

Code

Ticket #2185 (closed: fixed)

Opened 2 years ago

Last modified 2 years ago

require_http_methods "raise"s HttpResponseForbidden

Reported by: Maniac@SoftwareManiacs.Org Assigned to: mtredinnick
Milestone: Component: Core framework
Version: Keywords:
Cc: Maniac@SoftwareManiacs.Org Triage Stage: Unreviewed
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

django.views.decorators.http.require_http_methods in case of invalid method "raise"s an instance of HttpResponseForbidden? which is not an Exception. Now it ends up in a form of 500 error.

I think we need an exceptions similar to Http404 for this case. Not sure if it should be called Http403 or HttpForbidden?...

Attachments

Change History

06/18/06 01:16:47 changed by anonymous

  • cc set to Maniac@SoftwareManiacs.Org.

06/18/06 01:48:58 changed by mtredinnick

This will be fixed by #1646 (which is on my list to commit shortly).

06/18/06 01:49:19 changed by mtredinnick

  • owner changed from adrian to mtredinnick.

06/18/06 01:53:51 changed by anonymous

BTW if the decorator would just return HttpResponseNotAlowed? with some default message this won't be localizable (nor pretty). I'm starting to think that all "negative" HTTP answers should be treated like 404 and 500 now, allowing for custom template and view.

06/18/06 21:06:25 changed by mtredinnick

The 405 error typically does not have a body, just a list of HTTP methods that *are* acceptable in a subsequent retry. So this doesn't have any internationalization impact.

06/19/06 22:17:57 changed by adrian

  • status changed from new to closed.
  • resolution set to fixed.

(In [3163]) Fixed #2185 -- Changed django.views.decorators.http.require_http_methods decorator to use HttpResponseNotAllowed? instead of HttpResponseForbidden?


Add/Change #2185 (require_http_methods "raise"s HttpResponseForbidden)




Change Properties
Action