mirror of
https://github.com/kataras/iris.git
synced 2026-01-10 05:25:58 +00:00
replace ioutil with io package and other minor improvements
This commit is contained in:
@@ -13,11 +13,12 @@ import (
|
||||
// The Iris server SHOULD run under HTTP/2 and clients too.
|
||||
//
|
||||
// Usage:
|
||||
// import grpcWrapper "github.com/kataras/iris/v12/middleware/grpc"
|
||||
// [...]
|
||||
// app := iris.New()
|
||||
// grpcServer := grpc.NewServer()
|
||||
// app.WrapRouter(grpcWrapper.New(grpcServer))
|
||||
//
|
||||
// import grpcWrapper "github.com/kataras/iris/v12/middleware/grpc"
|
||||
// [...]
|
||||
// app := iris.New()
|
||||
// grpcServer := grpc.NewServer()
|
||||
// app.WrapRouter(grpcWrapper.New(grpcServer))
|
||||
func New(grpcServer http.Handler) router.WrapperFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request, mux http.HandlerFunc) {
|
||||
if r.ProtoMajor == 2 && strings.HasPrefix(r.Header.Get("Content-Type"), "application/grpc") {
|
||||
|
||||
Reference in New Issue
Block a user