Skip to content

Commit

Permalink
Add parse fragment URL
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugene Medvedev committed May 28, 2019
1 parent 344e23d commit ee9b5ba
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions sicra/crawler.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,13 @@ func urlEscape(refurl string) string {
host := parseURL.Host
pathuri := parseURL.EscapedPath()
query := url.QueryEscape(parseURL.RawQuery)

escapeURL := (scheme + "://" + host + pathuri + "?" + query)
if query != "" {
query = "?" + query
}
fragment := url.QueryEscape(parseURL.Fragment)
if fragment != "" {
fragment = "#" + fragment
}
escapeURL := (scheme + "://" + host + pathuri + query + fragment)
return escapeURL
}

0 comments on commit ee9b5ba

Please sign in to comment.