mirror of
https://github.com/kataras/iris.git
synced 2025-12-20 11:27:06 +00:00
add Context.SetVersion helper
Former-commit-id: 605d6c1e78f73b8f2c89bd2dc7ee23f21551d47b
This commit is contained in:
@@ -43,7 +43,7 @@ func NewMatcher(versions Map) context.Handler {
|
||||
|
||||
return func(ctx context.Context) {
|
||||
versionString := GetVersion(ctx)
|
||||
if versionString == NotFound {
|
||||
if versionString == "" || versionString == NotFound {
|
||||
notFoundHandler(ctx)
|
||||
return
|
||||
}
|
||||
@@ -63,7 +63,7 @@ func NewMatcher(versions Map) context.Handler {
|
||||
}
|
||||
|
||||
// pass the not matched version so the not found handler can have knowedge about it.
|
||||
// ctx.Values().Set(Key, versionString)
|
||||
// ctx.SetVersion(versionString)
|
||||
// or let a manual cal of GetVersion(ctx) do that instead.
|
||||
notFoundHandler(ctx)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user