Upgrading server dependancies (#6431)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
cd23b8139a
Коммит
d103ed6ca9
2
vendor/github.com/gorilla/handlers/README.md
сгенерированный
поставляемый
2
vendor/github.com/gorilla/handlers/README.md
сгенерированный
поставляемый
@@ -1,6 +1,8 @@
|
||||
gorilla/handlers
|
||||
================
|
||||
[](https://godoc.org/github.com/gorilla/handlers) [](https://travis-ci.org/gorilla/handlers)
|
||||
[](https://sourcegraph.com/github.com/gorilla/handlers?badge)
|
||||
|
||||
|
||||
Package handlers is a collection of handlers (aka "HTTP middleware") for use
|
||||
with Go's `net/http` package (or any framework supporting `http.Handler`), including:
|
||||
|
||||
2
vendor/github.com/gorilla/handlers/handlers.go
сгенерированный
поставляемый
2
vendor/github.com/gorilla/handlers/handlers.go
сгенерированный
поставляемый
@@ -94,7 +94,7 @@ func makeLogger(w http.ResponseWriter) loggingResponseWriter {
|
||||
return logger
|
||||
}
|
||||
|
||||
type loggingResponseWriter interface {
|
||||
type commonLoggingResponseWriter interface {
|
||||
http.ResponseWriter
|
||||
http.Flusher
|
||||
Status() int
|
||||
|
||||
21
vendor/github.com/gorilla/handlers/handlers_go18.go
сгенерированный
поставляемый
Обычный файл
21
vendor/github.com/gorilla/handlers/handlers_go18.go
сгенерированный
поставляемый
Обычный файл
@@ -0,0 +1,21 @@
|
||||
// +build go1.8
|
||||
|
||||
package handlers
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
type loggingResponseWriter interface {
|
||||
commonLoggingResponseWriter
|
||||
http.Pusher
|
||||
}
|
||||
|
||||
func (l *responseLogger) Push(target string, opts *http.PushOptions) error {
|
||||
p, ok := l.w.(http.Pusher)
|
||||
if !ok {
|
||||
return fmt.Errorf("responseLogger does not implement http.Pusher")
|
||||
}
|
||||
return p.Push(target, opts)
|
||||
}
|
||||
34
vendor/github.com/gorilla/handlers/handlers_go18_test.go
сгенерированный
поставляемый
Обычный файл
34
vendor/github.com/gorilla/handlers/handlers_go18_test.go
сгенерированный
поставляемый
Обычный файл
@@ -0,0 +1,34 @@
|
||||
// +build go1.8
|
||||
|
||||
package handlers
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestLoggingHandlerWithPush(t *testing.T) {
|
||||
handler := http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
|
||||
if _, ok := w.(http.Pusher); !ok {
|
||||
t.Fatalf("%T from LoggingHandler does not satisfy http.Pusher interface when built with Go >=1.8", w)
|
||||
}
|
||||
w.WriteHeader(200)
|
||||
})
|
||||
|
||||
logger := LoggingHandler(ioutil.Discard, handler)
|
||||
logger.ServeHTTP(httptest.NewRecorder(), newRequest("GET", "/"))
|
||||
}
|
||||
|
||||
func TestCombinedLoggingHandlerWithPush(t *testing.T) {
|
||||
handler := http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
|
||||
if _, ok := w.(http.Pusher); !ok {
|
||||
t.Fatalf("%T from CombinedLoggingHandler does not satisfy http.Pusher interface when built with Go >=1.8", w)
|
||||
}
|
||||
w.WriteHeader(200)
|
||||
})
|
||||
|
||||
logger := CombinedLoggingHandler(ioutil.Discard, handler)
|
||||
logger.ServeHTTP(httptest.NewRecorder(), newRequest("GET", "/"))
|
||||
}
|
||||
7
vendor/github.com/gorilla/handlers/handlers_pre18.go
сгенерированный
поставляемый
Обычный файл
7
vendor/github.com/gorilla/handlers/handlers_pre18.go
сгенерированный
поставляемый
Обычный файл
@@ -0,0 +1,7 @@
|
||||
// +build !go1.8
|
||||
|
||||
package handlers
|
||||
|
||||
type loggingResponseWriter interface {
|
||||
commonLoggingResponseWriter
|
||||
}
|
||||
Ссылка в новой задаче
Block a user