updates for neffos and re-push the fix of the request path with uri unescaped codes

Former-commit-id: fda1edb3e8dfc538da541070366f5f8f997bf367
This commit is contained in:
Gerasimos (Makis) Maropoulos 2019-06-06 23:05:17 +03:00
parent e19a519c6e
commit e10fada695
4 changed files with 9 additions and 9 deletions

View File

@ -1473,7 +1473,7 @@ func DecodeURL(uri string) string {
// based on the 'escape'.
func (ctx *context) RequestPath(escape bool) string {
if escape {
return DecodeQuery(ctx.request.URL.EscapedPath())
return ctx.request.URL.EscapedPath() // DecodeQuery(ctx.request.URL.EscapedPath())
}
return ctx.request.URL.Path // RawPath returns empty, requesturi can be used instead also.
}

2
go.mod
View File

@ -15,7 +15,7 @@ require (
github.com/iris-contrib/go.uuid v2.0.0+incompatible
github.com/json-iterator/go v1.1.6
github.com/kataras/golog v0.0.0-20180321173939-03be10146386
github.com/kataras/neffos v0.0.0-20190603085547-9fba63259400
github.com/kataras/neffos v0.0.0-20190606200227-c8dd500b4cdf
github.com/kataras/pio v0.0.0-20190103105442-ea782b38602d // indirect
github.com/microcosm-cc/bluemonday v1.0.2
github.com/ryanuber/columnize v2.1.0+incompatible

4
go.sum
View File

@ -28,8 +28,8 @@ github.com/json-iterator/go v1.1.6 h1:MrUvLMLTMxbqFJ9kzlvat/rYZqZnW3u4wkLzWTaFwK
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/kataras/golog v0.0.0-20180321173939-03be10146386 h1:VT6AeCHO/mc+VedKBMhoqb5eAK8B1i9F6nZl7EGlHvA=
github.com/kataras/golog v0.0.0-20180321173939-03be10146386/go.mod h1:PcaEvfvhGsqwXZ6S3CgCbmjcp+4UDUh2MIfF2ZEul8M=
github.com/kataras/neffos v0.0.0-20190603085547-9fba63259400 h1:4Vmw9gER3G+QRYFP9Kt8KK01kwVfAE+EoXgiuCzn4oI=
github.com/kataras/neffos v0.0.0-20190603085547-9fba63259400/go.mod h1:XfxmcgJUtbPmzK9wPLE7ybFHXoCqZKGptaW1frrxFhw=
github.com/kataras/neffos v0.0.0-20190606200227-c8dd500b4cdf h1:rHFU6nupBNP5RejMwghFnhjUoOFXAYxmE07s4f5aeXQ=
github.com/kataras/neffos v0.0.0-20190606200227-c8dd500b4cdf/go.mod h1:XfxmcgJUtbPmzK9wPLE7ybFHXoCqZKGptaW1frrxFhw=
github.com/kataras/pio v0.0.0-20190103105442-ea782b38602d h1:V5Rs9ztEWdp58oayPq/ulmlqJJZeJP6pP79uP3qjcao=
github.com/kataras/pio v0.0.0-20190103105442-ea782b38602d/go.mod h1:NV88laa9UiiDuX9AhMbDPkGYSPugBOV6yTZB1l2K9Z0=
github.com/microcosm-cc/bluemonday v1.0.2 h1:5lPfLTTAvAbtS0VqT+94yOtFnGfUWYyx0+iToC3Os3s=

View File

@ -79,21 +79,21 @@ var (
// with the exact same incoming Message's Namespace (and Room if specified)
// except its body which would be the given "body".
Reply = neffos.Reply
// Object marshals the "v" value and returns a Message's Body.
// The "v" serialized value can be customized by implementing a `Marshal() ([]byte, error) ` method,
// Marshal marshals the "v" value and returns a Message's Body.
// The "v" value's serialized value can be customized by implementing a `Marshal() ([]byte, error) ` method,
// otherwise the default one will be used instead ( see `SetDefaultMarshaler` and `SetDefaultUnmarshaler`).
// Errors are pushed to the result, use the object's Marshal method to catch those when necessary.
Object = neffos.Object
Marshal = neffos.Marshal
)
// SetDefaultMarshaler changes the default json marshaler.
// See `Object` package-level function and `Message.Object` method for more.
// See `Marshal` package-level function and `Message.Unmarshal` method for more.
func SetDefaultMarshaler(fn func(v interface{}) ([]byte, error)) {
neffos.DefaultMarshaler = fn
}
// SetDefaultUnmarshaler changes the default json unmarshaler.
// See `Object` package-level function and `Message.Object` method for more.
// See `Message.Unmarshal` method and package-level `Marshal` function for more.
func SetDefaultUnmarshaler(fn func(data []byte, v interface{}) error) {
neffos.DefaultUnmarshaler = fn
}