Created
September 30, 2022 11:46
-
-
Save agehlot/85ee3ca7990c0c11c26b739606f9c618 to your computer and use it in GitHub Desktop.
Disable other methods except get and post in the inbound request
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<on-error> | |
<base /> | |
<choose> | |
<when condition="@(context.Request.Method != "GET" && context.Request.Method != "POST")"> | |
<return-response> | |
<set-status code="405" reason="Method not allowed" /> | |
<set-body>@{ | |
return new JObject( | |
new JProperty("status", "HTTP 405"), | |
new JProperty("message", "Method not allowed") | |
).ToString(); | |
}</set-body> | |
</return-response> | |
</when> | |
<otherwise /> | |
</choose> | |
</on-error> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment