Lava Webhook of Method PUT or PATCH don't resolve
Prerequisites
- [x] Put an X between the brackets on this line if you have done all of the following:
- Can you reproduce the problem on a fresh install or the [http://rock.rocksolidchurchdemo.com/ demo site ]()?
- Did you include your Rock version number and [https://github.com/SparkDevNetwork/Rock/wiki/Environment-and-Diagnostics-Information client culture ]() setting?
- Did you [https://github.com/issues?q=is%3Aissue+user%3ASparkDevNetwork+-repo%3ASparkDevNetwork%2FSlack perform a cursory search ]() to see if your bug or enhancement is already reported?
Description
If you create a lava webhook with a method of PUT or PATCH, it does not seem to add the route. If you switch it to POST, it works fine.
Steps to Reproduce
- Create a Lava Webhook called /test123
- Set the method to PUT
- Using Postman, hit the URL with the PUT Verb (you should get "this page does not exist")
- Update your webhook to PATCH
- Using Postman, hit the URL with the PATCH Verb (you should get "this page does not exist")
- Update your webhook to POST
- Using Postman, hit the URL with the POST Verb (Success!)
Expected behavior: PATCH and PUT routes should be defined.
Actual behavior: Rock doesn't know they exist.
Versions
- Rock Version: 7.5
- Client Culture Setting: en-US
Admittedly, I never tested this with PUT and PATCH specifically. I just included those verbs as a "why not". I wonder if IIS is internally trying to handle those rather than letting the web hook handle it.
@cabal95 are you able to look at this?
Yes, I'll take a look and see if I can verify what the core issue is.
It looks like this is an issue at the web.config level. Or more specifically, at the "server" level web.config.
The default handler mapping for .ashx files appears to only support GET, HEAD, POST, and DEBUG (oddly enough). I tested enabling the other two on my IIS Express and it seems to work. If you want to test enabling this in full IIS and report back we can discuss if it is something we should:
- Override in
web.configautomatically via an update - Update the Defined Type to include instructions on how to do this manually if you want to use
PUT,PATCHorDELETE - Just remove those three options. (I'd like to keep them, but I'm not married to it since I don't use those 2 verbs myself)
To enable for testing:
- Open IIS Manager and go to your Site.
- Go to the
Handler Mappings - Look for the 6
*.ashxhandlers (pictured below). - Open each one in turn, click
Request Restrictions, go to theVerbstab, and add,PUT,PATCH,DELETEto the text box - (Doing this will almost certainly restart Rock, so make sure you don't do it during prime time)
edit: picture I forgot:

Is not having support for PUT/PATCH a deal since Lava can't update data?
It's not a huge issue, but the Lava Webhooks have their own Entity Command enabling, so they can use {% sql %} statements to make updates. We are actually doing this with a metric via a GET request to a specific API (probably should have made it a POST or PUT or something but wasn't thinking that far ahead). Every hit to the API runs a SQL query that increments the value of a specific metric.
A fourth option, would be to convert the attribute to be a plain Text attribute. This shouldn't cause any backwards compatibility issues. It would require the user to specifically put in the verb name (GET, POST, etc.) - though we could make it default to GET if not specified as that is probably the most common one. This would allow for people to still use the "unsupported" verbs if they want without advertising that they should work out of the box.