Browse Source

ISSUE-164 (#166)

tags/v1.0.0
Andrea Spacca 5 years ago
committed by GitHub
parent
commit
60c1c1a116
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      server/handlers.go

+ 3
- 3
server/handlers.go View File

@@ -95,7 +95,6 @@ func healthHandler(w http.ResponseWriter, r *http.Request) {

/* The preview handler will show a preview of the content for browsers (accept type text/html), and referer is not transfer.sh */
func (s *Server) previewHandler(w http.ResponseWriter, r *http.Request) {

vars := mux.Vars(r)

token := vars["token"]
@@ -151,8 +150,9 @@ func (s *Server) previewHandler(w http.ResponseWriter, r *http.Request) {
return
}

resolvedUrl := resolveUrl(r, getURL(r).ResolveReference(r.URL), true)
var png []byte
png, err = qrcode.Encode(resolveUrl(r, getURL(r).ResolveReference(r.URL), true), qrcode.High, 150)
png, err = qrcode.Encode(resolvedUrl, qrcode.High, 150)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
@@ -173,7 +173,7 @@ func (s *Server) previewHandler(w http.ResponseWriter, r *http.Request) {
contentType,
content,
filename,
r.URL.String(),
resolvedUrl,
contentLength,
s.gaKey,
s.userVoiceKey,


Loading…
Cancel
Save