summaryrefslogtreecommitdiffstats
path: root/transform
diff options
context:
space:
mode:
authorHelder Pereira <helfper@gmail.com>2020-06-14 10:14:56 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2020-06-14 14:08:41 +0200
commit145b3fcce35fbac25c7033c91c1b7ae6d1179da8 (patch)
treecdcf5e36e05c5fe3ba36039a830eff9bf10e60df /transform
parent01e249e97ce9a3bc145f4372a032b9da3e123a62 (diff)
Fix aliases with relativeURLs
Diffstat (limited to 'transform')
-rw-r--r--transform/urlreplacers/absurlreplacer.go1
-rw-r--r--transform/urlreplacers/absurlreplacer_test.go4
2 files changed, 3 insertions, 2 deletions
diff --git a/transform/urlreplacers/absurlreplacer.go b/transform/urlreplacers/absurlreplacer.go
index 3fef013fb..7bac716fb 100644
--- a/transform/urlreplacers/absurlreplacer.go
+++ b/transform/urlreplacers/absurlreplacer.go
@@ -69,6 +69,7 @@ func newPrefixState() []*prefix {
return []*prefix{
{b: []byte("src="), f: checkCandidateBase},
{b: []byte("href="), f: checkCandidateBase},
+ {b: []byte("url="), f: checkCandidateBase},
{b: []byte("action="), f: checkCandidateBase},
{b: []byte("srcset="), f: checkCandidateSrcset},
}
diff --git a/transform/urlreplacers/absurlreplacer_test.go b/transform/urlreplacers/absurlreplacer_test.go
index 3c2dbf777..8e8fdc561 100644
--- a/transform/urlreplacers/absurlreplacer_test.go
+++ b/transform/urlreplacers/absurlreplacer_test.go
@@ -88,8 +88,8 @@ schemaless: &lt;img srcset=&#39;//img.jpg&#39; src=&#39;//basic.jpg&#39;&gt;
schemaless2: &lt;img srcset=&quot;//img.jpg&quot; src=&quot;//basic.jpg2&gt; 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.`
+ relPathVariations = `PRE. a href="/img/small.jpg" input action="/foo.html" meta url=/redirect/to/page/ POST.`
+ relPathVariationsCorrect = `PRE. a href="../../img/small.jpg" input action="../../foo.html" meta url=../../redirect/to/page/ POST.`
testBaseURL = "http://base/"
)