Skip to content

Commit

Permalink
Create DetectSafeHttpMethods.bambda
Browse files Browse the repository at this point in the history
It ensures that the HTTP method is not one of the excluded methods listed
  • Loading branch information
ctflearner authored Dec 18, 2024
1 parent e1154e5 commit 71addc3
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Filter/Proxy/HTTP/DetectSafeHttpMethods.bambda
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* Bambda Script to Detect "Safe or Typical HTTP Methods in Requests"
* @author ctflearner
* This script identifies HTTP requests that use typical or safe methods such as GET and POST,
* excluding less common or potentially unsafe methods like PUT, PATCH, DELETE, HEAD, OPTIONS, TRACE, and CONNECT.
* It ensures that the HTTP method is not one of the excluded methods listed.
**/



return !requestResponse.request().method().equals("PUT") &&
!requestResponse.request().method().equals("PATCH") &&
!requestResponse.request().method().equals("DELETE") &&
!requestResponse.request().method().equals("HEAD") &&
!requestResponse.request().method().equals("OPTIONS") &&
!requestResponse.request().method().equals("TRACE") &&
!requestResponse.request().method().equals("CONNECT");

0 comments on commit 71addc3

Please sign in to comment.