From 2e41852860bea0b18787c4741d11c0ed47aacda2 Mon Sep 17 00:00:00 2001 From: Andrea Spacca Date: Tue, 16 Jul 2019 20:51:31 +0200 Subject: [PATCH] fix resolved url --- go.mod | 2 +- go.sum | 2 ++ server/handlers.go | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 6c5ce9a..52bc078 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/aws/aws-sdk-go v1.20.6 github.com/dutchcoders/go-clamd v0.0.0-20170520113014-b970184f4d9e github.com/dutchcoders/go-virustotal v0.0.0-20140923143438-24cc8e6fa329 - github.com/dutchcoders/transfer.sh-web v0.0.0-20190520063132-37110d436c89 + github.com/dutchcoders/transfer.sh-web v0.0.0-20190716184912-96e06a2276ba github.com/elazarl/go-bindata-assetfs v1.0.0 github.com/fatih/color v1.7.0 github.com/garyburd/redigo v1.6.0 // indirect diff --git a/go.sum b/go.sum index 6737212..ec87c71 100644 --- a/go.sum +++ b/go.sum @@ -17,6 +17,8 @@ github.com/dutchcoders/go-virustotal v0.0.0-20140923143438-24cc8e6fa329 h1:ERqCk github.com/dutchcoders/go-virustotal v0.0.0-20140923143438-24cc8e6fa329/go.mod h1:G5qOfE5bQZ5scycLpB7fYWgN4y3xdfXo+pYWM8z2epY= github.com/dutchcoders/transfer.sh-web v0.0.0-20190520063132-37110d436c89 h1:FJc5t2SEtRmLXDWxHFQG4QB98Vqr7/60cIiUT2F5yAA= github.com/dutchcoders/transfer.sh-web v0.0.0-20190520063132-37110d436c89/go.mod h1:UjR1zlrq/R2Sef7e4q3TeJm4HcbLh4vRzlCEGJP+wLg= +github.com/dutchcoders/transfer.sh-web v0.0.0-20190716184912-96e06a2276ba h1:474BcGUqYKnxg49p7O7i3m9EuFfOag+OtPw5b/nmGVk= +github.com/dutchcoders/transfer.sh-web v0.0.0-20190716184912-96e06a2276ba/go.mod h1:UjR1zlrq/R2Sef7e4q3TeJm4HcbLh4vRzlCEGJP+wLg= github.com/elazarl/go-bindata-assetfs v1.0.0 h1:G/bYguwHIzWq9ZoyUQqrjTmJbbYn3j3CKKpKinvZLFk= github.com/elazarl/go-bindata-assetfs v1.0.0/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo7R71Vk1u8bnjau5yw4= github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= diff --git a/server/handlers.go b/server/handlers.go index f83638b..815b1e3 100644 --- a/server/handlers.go +++ b/server/handlers.go @@ -157,9 +157,9 @@ func (s *Server) previewHandler(w http.ResponseWriter, r *http.Request) { } relativeURL, _ := url.Parse(path.Join(s.proxyPath, token, filename)) - resolvedURL := resolveURL(r, getURL(r).ResolveReference(relativeURL), true) + resolvedURL := resolveURL(r, relativeURL, true) relativeURLGet, _ := url.Parse(path.Join(s.proxyPath, getPathPart, token, filename)) - resolvedURLGet := resolveURL(r, getURL(r).ResolveReference(relativeURLGet), true) + resolvedURLGet := resolveURL(r, relativeURLGet, true) var png []byte png, err = qrcode.Encode(resolvedURL, qrcode.High, 150) if err != nil {