forked from bazelbuild/rules_closure
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WebfilesValidator: whitelist
mailto:
URLs
Summary: This patch teaches `WebfilesValidator` that `mailto:` URLs don’t express webfiles dependency relationships, and so do not need to be accompanied by a `web_library` provider. See: <tensorflow/tensorboard#2297> Test Plan: Unit test added; it fails before this change and passes after it. wchargin-branch: whitelist-mailto
- Loading branch information
Showing
2 changed files
with
17 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -205,6 +205,22 @@ public void dataUris_getIgnored() throws Exception { | |
.isEmpty(); | ||
} | ||
|
||
@Test | ||
public void mailtoUris_getIgnored() throws Exception { | ||
save(fs.getPath("/fs/path/index.html"), "<a href=\"mailto:[email protected]\">email us</a>\n"); | ||
assertThat( | ||
validator.validate( | ||
Webfiles.newBuilder() | ||
.addSrc(WebfilesSource.newBuilder() | ||
.setPath("/fs/path/index.html") | ||
.setWebpath("/web/path/index.html") | ||
.build()) | ||
.build(), | ||
ImmutableList.<Webfiles>of(), | ||
Suppliers.ofInstance(ImmutableList.<Webfiles>of()))) | ||
.isEmpty(); | ||
} | ||
|
||
@Test | ||
public void cssUrls_areRecognized() throws Exception { | ||
save(fs.getPath("/fs/path/index.html"), "<link rel=\"stylesheet\" href=\"index.css\">"); | ||
|