Skip to content

Commit

Permalink
chore: remove method verification
Browse files Browse the repository at this point in the history
  • Loading branch information
Lightning00Blade committed May 27, 2024
1 parent fcdba51 commit 1f7bc73
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions src/bidiMapper/modules/network/NetworkProcessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,6 @@ export class NetworkProcessor {
NetworkProcessor.validateHeaders(params.headers);
}

if (params.method !== undefined) {
NetworkProcessor.validateMethod(params.method);
}

const request = this.#getBlockedRequestOrFail(networkId, [
Network.InterceptPhase.BeforeRequestSent,
]);
Expand Down Expand Up @@ -340,18 +336,6 @@ export class NetworkProcessor {
}
}

/**
* Validate https://httpwg.org/specs/rfc9110.html#method.overview
* CDP accepts custom Methods but they fail in the fetch script
*/
static validateMethod(method: string) {
if (!/^(GET|HEAD|POST|PUT|DELETE|CONNECT|OPTIONS|TRACE)$/.test(method)) {
throw new InvalidArgumentException(
`Method '${method}' is not acceptable value`
);
}
}

/**
* Attempts to parse the given url.
* Throws an InvalidArgumentException if the url is invalid.
Expand Down

0 comments on commit 1f7bc73

Please sign in to comment.