Skip to content

Commit

Permalink
Merge pull request #146 from oduwsdl/issue-110
Browse files Browse the repository at this point in the history
Handle escaped URI-Rs
  • Loading branch information
ibnesayeed authored Apr 17, 2024
2 parents 39c3610 + e6e7820 commit ae71612
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -472,10 +472,16 @@ func aggregateTimemap(urir string, dttmp *time.Time, sess *Session) (basetm *lis
}

func parseURI(uri string) (urir string, err error) {
if !regs["isprtcl"].MatchString(uri) {
uri = "http://" + uri
uescd, err := url.PathUnescape(uri)
if err != nil {
logError.Printf("Error Unescaping path (%s): %v", uri, err)
return
}
uescd = strings.ReplaceAll(uescd, " ", "%20")
if !regs["isprtcl"].MatchString(uescd) {
uescd = "http://" + uescd
}
u, err := url.Parse(uri)
u, err := url.Parse(uescd)
if err == nil {
urir = u.String()
}
Expand Down

0 comments on commit ae71612

Please sign in to comment.