Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

added support for X-HTTP-method-override header. only tested running und #113

Open
wants to merge 1 commit into from

2 participants

@notatoad

added support for X-HTTP-method-override header. only tested running under isapi/iis. i'm very noob, and have no idea if i've done this right or not, but it works for my needs. i'd love to hear anybody's feedback.

@notatoad notatoad added support for X-HTTP-method-override header. only tested running …
…under isapi/iis. i'm very noob, and have no idea if i've done this right or not, but it works for my needs. i'd love to hear anybody's feedback.
4872e4f
@aaronsw
Owner

The patch looks reasonable but I worry that this has security implications. Can we make it off by default and allow people to turn it on?

@notatoad

you mean just comment it out by default, or put a switch in a config file somewhere? i can do the former, the latter probably goes beyond my knowledge of how webpy works.

@aaronsw
Owner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 31, 2011
  1. @notatoad

    added support for X-HTTP-method-override header. only tested running …

    notatoad authored
    …under isapi/iis. i'm very noob, and have no idea if i've done this right or not, but it works for my needs. i'd love to hear anybody's feedback.
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 0 deletions.
  1. +3 −0  web/application.py
View
3  web/application.py
@@ -377,6 +377,9 @@ def load(self, env):
def _delegate(self, f, fvars, args=[]):
def handle_class(cls):
meth = web.ctx.method
+ override = web.ctx.env.get("HTTP_X_HTTP_METHOD_OVERRIDE", None)
+ if override in ("PUT", "DELETE",):
+ meth=override
if meth == 'HEAD' and not hasattr(cls, meth):
meth = 'GET'
if not hasattr(cls, meth):
Something went wrong with that request. Please try again.