Merge branch 'master' into content-type
This commit is contained in:
commit
426c4589d3
|
|
@ -103,7 +103,7 @@ func (m *Middleware) GetHandler(metadata middleware.Metadata) (func(h fasthttp.R
|
||||||
|
|
||||||
return func(h fasthttp.RequestHandler) fasthttp.RequestHandler {
|
return func(h fasthttp.RequestHandler) fasthttp.RequestHandler {
|
||||||
return func(ctx *fasthttp.RequestCtx) {
|
return func(ctx *fasthttp.RequestCtx) {
|
||||||
if handled := m.evalRequest(ctx, meta, &query); handled {
|
if allow := m.evalRequest(ctx, meta, &query); !allow {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
h(ctx)
|
h(ctx)
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,11 @@ import (
|
||||||
"github.com/dapr/kit/logger"
|
"github.com/dapr/kit/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
func mockedRequestHandler(ctx *fh.RequestCtx) {}
|
// mockedRequestHandler acts like an upstream service returns success status code 200 and a fixed response body.
|
||||||
|
func mockedRequestHandler(ctx *fh.RequestCtx) {
|
||||||
|
ctx.Response.SetStatusCode(200)
|
||||||
|
ctx.Response.SetBody([]byte("from mock"))
|
||||||
|
}
|
||||||
|
|
||||||
type RequestConfiguator func(*fh.RequestCtx)
|
type RequestConfiguator func(*fh.RequestCtx)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue