mirror of
https://github.com/kataras/iris.git
synced 2026-01-09 13:05:56 +00:00
use the new protobuf package and other minor stuff
Former-commit-id: 29bf71e8a73d34b27c6f5fe3f12c4ea1cc2b84b2
This commit is contained in:
@@ -42,10 +42,11 @@ func TestFromStdWithNext(t *testing.T) {
|
||||
basicauth := "secret"
|
||||
passed := "ok"
|
||||
|
||||
type contextKey string
|
||||
stdWNext := func(w http.ResponseWriter, r *http.Request, next http.HandlerFunc) {
|
||||
if username, password, ok := r.BasicAuth(); ok &&
|
||||
username == basicauth && password == basicauth {
|
||||
ctx := stdContext.WithValue(r.Context(), "key", "ok")
|
||||
ctx := stdContext.WithValue(r.Context(), contextKey("key"), "ok")
|
||||
next.ServeHTTP(w, r.WithContext(ctx))
|
||||
return
|
||||
}
|
||||
@@ -54,7 +55,7 @@ func TestFromStdWithNext(t *testing.T) {
|
||||
|
||||
h := handlerconv.FromStdWithNext(stdWNext)
|
||||
next := func(ctx context.Context) {
|
||||
ctx.WriteString(ctx.Request().Context().Value("key").(string))
|
||||
ctx.WriteString(ctx.Request().Context().Value(contextKey("key")).(string))
|
||||
}
|
||||
|
||||
app := iris.New()
|
||||
|
||||
@@ -60,7 +60,7 @@ func TestProxy(t *testing.T) {
|
||||
t.Fatalf("%v while creating tcp4 listener for new tls local test listener", err)
|
||||
}
|
||||
// main server
|
||||
go app.Run(iris.Listener(httptest.NewLocalTLSListener(l)), iris.WithoutStartupLog)
|
||||
go app.Run(iris.Listener(httptest.NewLocalTLSListener(l)), iris.WithoutStartupLog) // nolint:errcheck
|
||||
|
||||
e := httptest.NewInsecure(t, httptest.URL("http://"+listener.Addr().String()))
|
||||
e.GET("/").Expect().Status(iris.StatusOK).Body().Equal(expectedIndex)
|
||||
|
||||
@@ -395,7 +395,7 @@ func (su *Supervisor) runTLS(getCertificate func(*tls.ClientHelloInfo) (*tls.Cer
|
||||
tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
|
||||
tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,
|
||||
tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
|
||||
tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,
|
||||
// tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, G402: TLS Bad Cipher Suite
|
||||
0xC028, /* TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 */
|
||||
},
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ func (h *routerHandler) Build(provider RoutesProvider) error {
|
||||
// before sort.
|
||||
for _, r := range registeredRoutes {
|
||||
if r.topLink != nil {
|
||||
bindMultiParamTypesHandler(r.topLink, r)
|
||||
bindMultiParamTypesHandler(r)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -279,7 +279,7 @@ func (h *routerHandler) Build(provider RoutesProvider) error {
|
||||
return errgroup.Check(rp)
|
||||
}
|
||||
|
||||
func bindMultiParamTypesHandler(top *Route, r *Route) {
|
||||
func bindMultiParamTypesHandler(r *Route) {
|
||||
r.BuildHandlers()
|
||||
|
||||
// println("here for top: " + top.Name + " and current route: " + r.Name)
|
||||
|
||||
@@ -85,7 +85,7 @@ func TestOnAnyErrorCode(t *testing.T) {
|
||||
func checkAndClearBuf(t *testing.T, buff *bytes.Buffer, expected string) {
|
||||
t.Helper()
|
||||
|
||||
if got, expected := buff.String(), expected; got != expected {
|
||||
if got := buff.String(); got != expected {
|
||||
t.Fatalf("expected middleware to run before the error handler, expected: '%s' but got: '%s'", expected, got)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user