Skip to content

Commit

Permalink
Fixed protocol validation to include web+ protocols. (#3913)
Browse files Browse the repository at this point in the history
fixes #3912

## PR Type

Bugfix 


## Describe the current behavior?
Protocol validation doesn't include web+ protocols.

## Describe the new behavior?
Protocol validation now includes web+ protocols.

## PR Checklist

- [x ] Test: run `npm run test` and ensure that all tests pass
- [x ] Target main branch (or an appropriate release branch if
appropriate for a bug fix)
- [x ] Ensure that your contribution follows [standard accessibility
guidelines](https://docs.microsoft.com/en-us/microsoft-edge/accessibility/design).
Use tools like https://webhint.io/ to validate your changes.


## Additional Information
  • Loading branch information
russellbeattie authored Mar 20, 2023
1 parent 7d24dd4 commit e0a5e3d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libraries/manifest-validation/src/validations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ export const maniTests: Array<Validation> = [
const allValid = value.every((protocolHandler: any) => {
const isRelativeUrl = protocolHandler.url && protocolHandler.url.startsWith("/");
const hasProtocol = protocolHandler.protocol && protocolHandler.protocol.length > 0;
const isProtocolValid = hasProtocol && validProtocols.includes(protocolHandler.protocol);
const isProtocolValid = hasProtocol && (validProtocols.includes(protocolHandler.protocol) || protocolHandler.protocol.startsWith("web+"));
const hasUrl = protocolHandler.url && protocolHandler.url.length > 0;

return isRelativeUrl && hasProtocol && hasUrl && isProtocolValid;
Expand Down

0 comments on commit e0a5e3d

Please sign in to comment.