Skip to content

Commit

Permalink
Merge branch 'fix/94'
Browse files Browse the repository at this point in the history
  • Loading branch information
wjdp committed Sep 7, 2018
2 parents 7bed0d5 + 3616984 commit db89f38
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
5 changes: 5 additions & 0 deletions htmltest/check-generic.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ func (hT *HTMLTest) checkGenericRef(ref *htmldoc.Reference) {
}

func (hT *HTMLTest) enforceHTTPS(ref *htmldoc.Reference) {
// Does this url match an url ignore rule?
if hT.opts.isURLIgnored(ref.URLString()) {
return
}

if hT.opts.EnforceHTTPS {
hT.issueStore.AddIssue(issues.Issue{
Level: issues.LevelError,
Expand Down
10 changes: 10 additions & 0 deletions htmltest/check-link_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,16 @@ func TestAnchorExternalInsecureOption(t *testing.T) {
tExpectIssue(t, hT, "is not an HTTPS target", 1)
}

func TestAnchorExternalInsecureOptionIgnored(t *testing.T) {
// passes when checking for non-HTTPS links but they're in the IgnoreURLs list
hT := tTestFileOpts("fixtures/links/issues/94.html",
map[string]interface{}{
"EnforceHTTPS": true,
"IgnoreURLs": []interface{}{"plantuml.com", "plantuml.net", "forum.plantuml.net"},
})
tExpectIssueCount(t, hT, 0)
}

func TestAnchorExternalHrefIP(t *testing.T) {
// fails for broken IP address links
hT := tTestFileOpts("fixtures/links/ip_href.html",
Expand Down
11 changes: 11 additions & 0 deletions htmltest/fixtures/links/issues/94.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<meta http-equiv="refresh" content="3; url=http://forum.plantuml.net/3448/how-to-display-nested-tree-like-structure-in-a-class-body?show=3455#a3455">

<link type="text/css" href="http://forum.plantuml.net/44044.css">

<a href="http://forum.plantuml.net/3448/how-to-display-nested-tree-like-structure-in-a-class-body?show=3455#a3455">Source</a>
<a href="http://plantuml.net/class-diagram">http://plantuml.com/class-diagram</a>
<p><a href="http://forum.plantuml.net/7530/how-to-create-a-diagram-with-unconnected-nested-blocks?show=7531#a7531">Source</a>
</p>
<a href="http://forum.plantuml.net/7537/specify-nested-rectangles-to-be-created-in-vertical-order?show=7545#a7545">Source</a>

<script src="http://plantuml.com/scripty.js"></script>

0 comments on commit db89f38

Please sign in to comment.