Skip to content

Commit

Permalink
Merge pull request #108 from MeasureAuthoringTool/MAT-4193a
Browse files Browse the repository at this point in the history
MAT-4193a: Fixing WAF Intercept
  • Loading branch information
ethankaplan authored Nov 7, 2024
2 parents 2cb5be3 + c57b90e commit 805868e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/util/wafIntercept.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@ const wafIntercept = (error) => {
// Check for WAF block
if (
error?.response?.status === 403 &&
error?.response?.headers["content-type"].includes("text/html") &&
(JSON.stringify(error.response.data).includes("[email protected]") ||
JSON.stringify(error.response.data).includes("[email protected]"))
error?.response?.headers["content-type"]
.toLowerCase()
.includes("text/html") &&
(JSON.stringify(error.response.data)
.toLocaleLowerCase()
.includes("[email protected]") ||
JSON.stringify(error.response.data)
.toLowerCase()
.includes("[email protected]"))
) {
// eslint-disable-next-line no-console
console.log("WAF Interceptor Triggered");
Expand Down

0 comments on commit 805868e

Please sign in to comment.