Skip to content
This repository has been archived by the owner on Apr 9, 2022. It is now read-only.

Commit

Permalink
fix bug with some rare relative path situations
Browse files Browse the repository at this point in the history
  • Loading branch information
lrstanley committed Oct 19, 2016
1 parent e487921 commit 873518d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scraper/htmlparse.go
Expand Up @@ -104,7 +104,7 @@ func fmtTagLinks(src string, parent *url.URL) string {
// - url: http://domain.com/sub/path and resource: ./something/main.js
// would equal http://domain.com/sub/path/something/main.js
if strings.HasPrefix(src, "./") {
src = fmt.Sprintf("%s://%s", parent.Scheme, parent.Host+parent.Path+strings.SplitN(src, "./", 2)[1])
src = fmt.Sprintf("%s://%s%s/%s", parent.Scheme, parent.Host, strings.TrimRight(parent.Path, "/"), strings.SplitN(src, "./", 2)[1])
}

// site is loading resources from a remote location that supports both
Expand Down

0 comments on commit 873518d

Please sign in to comment.