Skip to content

Commit

Permalink
[WPS] Add option check incase the code is not updated for breaking ch…
Browse files Browse the repository at this point in the history
…anges (#18526)
  • Loading branch information
vicancy authored Nov 5, 2021
1 parent 61331e6 commit 573c765
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ export class CloudEventsDispatcher {
private readonly _allowAll: boolean = true;
private readonly _allowedOrigins: Array<string> = [];
constructor(private hub: string, private eventHandler?: WebPubSubEventHandlerOptions) {
if (Array.isArray(eventHandler)) {
throw new Error("Unexpected WebPubSubEventHandlerOptions");
}
if (eventHandler?.allowedEndpoints !== undefined) {
this._allowedOrigins = eventHandler.allowedEndpoints.map((endpoint) =>
new URL(endpoint).host.toLowerCase()
Expand Down

0 comments on commit 573c765

Please sign in to comment.