Skip to content
Permalink
Browse files

Rewrite relative action URLS

Fixes #5701
  • Loading branch information...
larson004 authored and bep committed Feb 26, 2019
1 parent 075b17e commit c154c2f7b2a6703dbde7f6bd2a1817a39c6fd2ea
Showing with 3 additions and 2 deletions.
  1. +1 −0 transform/urlreplacers/absurlreplacer.go
  2. +2 −2 transform/urlreplacers/absurlreplacer_test.go
@@ -49,6 +49,7 @@ func newPrefixState() []*prefix {
return []*prefix{
{b: []byte("src="), f: checkCandidateBase},
{b: []byte("href="), f: checkCandidateBase},
{b: []byte("action="), f: checkCandidateBase},
{b: []byte("srcset="), f: checkCandidateSrcset},
}
}
@@ -89,8 +89,8 @@ schemaless: <img srcset='//img.jpg' src='//basic.jpg'>
schemaless2: <img srcset="//img.jpg" src="//basic.jpg2> POST
`

relPathVariations = `PRE. a href="/img/small.jpg" POST.`
relPathVariationsCorrect = `PRE. a href="../../img/small.jpg" POST.`
relPathVariations = `PRE. a href="/img/small.jpg" input action="/foo.html" POST.`
relPathVariationsCorrect = `PRE. a href="../../img/small.jpg" input action="../../foo.html" POST.`

testBaseURL = "http://base/"
)

0 comments on commit c154c2f

Please sign in to comment.
You can’t perform that action at this time.