Go fmt and go vet happy
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
92c581e5a6
commit
3dc338c4a3
2
api.go
2
api.go
|
@ -42,7 +42,7 @@ func (a apiRouting) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
}
|
||||
|
||||
log.Printf("Handling %s request from %s: %s %s [%s]\n", r.Method, r.RemoteAddr, r.URL.Path, user, r.UserAgent())
|
||||
log.Printf("Handling %s request from %s: %s %v [%s]\n", r.Method, r.RemoteAddr, r.URL.Path, user, r.UserAgent())
|
||||
|
||||
// Extract URL arguments
|
||||
var sURL = strings.Split(r.URL.Path, "/")
|
||||
|
|
9
main.go
9
main.go
|
@ -19,7 +19,7 @@ import (
|
|||
var mux = http.NewServeMux()
|
||||
|
||||
type ResponseWriterPrefix struct {
|
||||
real http.ResponseWriter
|
||||
real http.ResponseWriter
|
||||
prefix string
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@ func (r ResponseWriterPrefix) Header() http.Header {
|
|||
|
||||
func (r ResponseWriterPrefix) WriteHeader(s int) {
|
||||
if v, exists := r.real.Header()["Location"]; exists {
|
||||
r.real.Header().Set("Location", r.prefix + v[0])
|
||||
r.real.Header().Set("Location", r.prefix+v[0])
|
||||
}
|
||||
r.real.WriteHeader(s)
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ func StripPrefix(prefix string, h http.Handler) http.Handler {
|
|||
}
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
if prefix != "/" && r.URL.Path == "/" {
|
||||
http.Redirect(w, r, prefix + "/", http.StatusFound)
|
||||
http.Redirect(w, r, prefix+"/", http.StatusFound)
|
||||
} else if p := strings.TrimPrefix(r.URL.Path, prefix); len(p) < len(r.URL.Path) {
|
||||
r2 := new(http.Request)
|
||||
*r2 = *r
|
||||
|
@ -80,7 +80,6 @@ func main() {
|
|||
tmp := ""
|
||||
baseURL = &tmp
|
||||
}
|
||||
|
||||
err = sanitizeStaticOptions()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
|
@ -111,7 +110,7 @@ func main() {
|
|||
mux.Handle("/", http.StripPrefix("/", SeeHandler()))
|
||||
|
||||
srv := &http.Server{
|
||||
Addr: *bind,
|
||||
Addr: *bind,
|
||||
Handler: StripPrefix(*baseURL, mux),
|
||||
}
|
||||
|
||||
|
|
|
@ -140,7 +140,7 @@ func AddImage(name string, author string, blob []byte) (string, error) {
|
|||
} else {
|
||||
dstImage = image.NewRGBA(image.Rect(0, 0, srcDim.Dy(), srcDim.Dx()))
|
||||
}
|
||||
graphics.Rotate(dstImage, img, &graphics.RotateOptions{orientation})
|
||||
graphics.Rotate(dstImage, img, &graphics.RotateOptions{Angle: orientation})
|
||||
img = dstImage
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue