Browse Source

Add newline for PUT response

pull/96/head v1.2.3
andreimarcu 9 years ago
parent
commit
81a1513809
  1. 3
      server_test.go
  2. 2
      upload.go

3
server_test.go

@ -4,6 +4,7 @@ import (
"bytes"
"crypto/tls"
"encoding/json"
"fmt"
"mime/multipart"
"net/http"
"net/http/httptest"
@ -611,7 +612,7 @@ func TestPutUpload(t *testing.T) {
mux.ServeHTTP(w, req)
if w.Body.String() != Config.siteURL+filename {
if w.Body.String() != fmt.Sprintf("%s\n", Config.siteURL+filename) {
t.Fatal("Response was not expected URL")
}
}

2
upload.go

@ -132,7 +132,7 @@ func uploadPutHandler(c web.C, w http.ResponseWriter, r *http.Request) {
return
}
fmt.Fprintf(w, getSiteURL(r)+upload.Filename)
fmt.Fprintf(w, "%s\n", getSiteURL(r)+upload.Filename)
}
}

Loading…
Cancel
Save