updates dockerfile to work with latest golang, adds .dockerignore, fixes CI (#4)
* adds support for https://github.com/golang/go/issues/32479 * updated dockerfile to work with latest golang, added .dockerignore
This commit is contained in:
parent
f72073e6ef
commit
ead67c221f
1
.dockerignore
Normal file
1
.dockerignore
Normal file
@ -0,0 +1 @@
|
||||
Dockerfile
|
@ -15,5 +15,5 @@ COPY . /go/src/pastebin
|
||||
|
||||
RUN go get -v -d
|
||||
RUN go get github.com/GeertJohan/go.rice/rice
|
||||
RUN rice embed-go
|
||||
RUN GOROOT=/go rice embed-go
|
||||
RUN go install -v
|
||||
|
@ -8,6 +8,7 @@ import (
|
||||
"log"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@ -19,7 +20,7 @@ import (
|
||||
"github.com/rcrowley/go-metrics/exp"
|
||||
"github.com/thoas/stats"
|
||||
|
||||
"github.com/GeertJohan/go.rice"
|
||||
rice "github.com/GeertJohan/go.rice"
|
||||
"github.com/julienschmidt/httprouter"
|
||||
"github.com/patrickmn/go-cache"
|
||||
"github.com/renstrom/shortuuid"
|
||||
@ -160,7 +161,7 @@ func (s *Server) DownloadHandler() httprouter.Handle {
|
||||
|
||||
w.Header().Set("Content-Disposition", "attachment; filename="+uuid)
|
||||
w.Header().Set("Content-Type", "application/octet-stream")
|
||||
w.Header().Set("Content-Length", string(content.Size()))
|
||||
w.Header().Set("Content-Length", strconv.FormatInt(content.Size(), 10))
|
||||
|
||||
http.ServeContent(w, r, uuid, time.Now(), content)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user