Skip to content

Commit

Permalink
fix(): roll back relativity check for now (#3821)
Browse files Browse the repository at this point in the history
fixes #[issue number] 
<!-- Link to relevant issue (for ex: "fixes #1234") which will
automatically close the issue once the PR is merged -->

## PR Type
<!-- Please uncomment one ore more that apply to this PR -->

<!-- - Bugfix -->
<!-- - Feature -->
<!-- - Code style update (formatting) -->
<!-- - Refactoring (no functional changes, no api changes) -->
<!-- - Build or CI related changes -->
<!-- - Documentation content changes -->
<!-- - Sample app changes -->
<!-- - Other... Please describe: -->


## Describe the current behavior?
<!-- Please describe the current behavior that is being modified or link
to a relevant issue. -->


## Describe the new behavior?


## PR Checklist

- [ ] Test: run `npm run test` and ensure that all tests pass
- [ ] Target main branch (or an appropriate release branch if
appropriate for a bug fix)
- [ ] 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

Co-authored-by: Justin Willis (HE / HIM) <[email protected]>
  • Loading branch information
jgw96 and Justin Willis (HE / HIM) committed Feb 6, 2023
1 parent 9b9dfe1 commit b9e90c7
Showing 1 changed file with 1 addition and 35 deletions.
36 changes: 1 addition & 35 deletions libraries/manifest-validation/src/validations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,41 +255,7 @@ export const maniTests: Array<Validation> = [
quickFix: true,
test: (value: string) => {
if (value && typeof value === "string" && value.length > 0) {
try {
// get current manifest
const currentMani = currentManifest;

const url = value;
//console.log("test url", url);

// is url relative to scope
let relativeToScope = false;
if (currentMani && currentMani.scope) {
//console.log("test scope", currentMani?.scope);
// is url relative to currentMani.scope
const scopeUrl = currentMani.scope;
//console.log("scope url", scopeUrl);

if (url.startsWith(scopeUrl)) {
relativeToScope = true;
}
else {
relativeToScope = false;
}
}
else if (currentMani && !currentMani.scope && (url.startsWith("/") || url.startsWith("https"))) {
relativeToScope = true;
}
else {
relativeToScope = false;
}

return relativeToScope;

}
catch {
return false;
}
return true;
}
else {
return false;
Expand Down

0 comments on commit b9e90c7

Please sign in to comment.