mirror of
https://github.com/kataras/iris.git
synced 2026-01-10 13:35:59 +00:00
fix #2147
This commit is contained in:
@@ -65,12 +65,28 @@ var _ HTTPErrorHandler = (*routerHandler)(nil)
|
|||||||
// NewDefaultHandler returns the handler which is responsible
|
// NewDefaultHandler returns the handler which is responsible
|
||||||
// to map the request with a route (aka mux implementation).
|
// to map the request with a route (aka mux implementation).
|
||||||
func NewDefaultHandler(config context.ConfigurationReadOnly, logger *golog.Logger) RequestHandler {
|
func NewDefaultHandler(config context.ConfigurationReadOnly, logger *golog.Logger) RequestHandler {
|
||||||
|
var (
|
||||||
|
disablePathCorrection bool
|
||||||
|
disablePathCorrectionRedirection bool
|
||||||
|
fireMethodNotAllowed bool
|
||||||
|
enablePathIntelligence bool
|
||||||
|
forceLowercaseRouting bool
|
||||||
|
)
|
||||||
|
|
||||||
|
if config != nil { // #2147
|
||||||
|
disablePathCorrection = config.GetDisablePathCorrection()
|
||||||
|
disablePathCorrectionRedirection = config.GetDisablePathCorrectionRedirection()
|
||||||
|
fireMethodNotAllowed = config.GetFireMethodNotAllowed()
|
||||||
|
enablePathIntelligence = config.GetEnablePathIntelligence()
|
||||||
|
forceLowercaseRouting = config.GetForceLowercaseRouting()
|
||||||
|
}
|
||||||
|
|
||||||
return &routerHandler{
|
return &routerHandler{
|
||||||
disablePathCorrection: config.GetDisablePathCorrection(),
|
disablePathCorrection: disablePathCorrection,
|
||||||
disablePathCorrectionRedirection: config.GetDisablePathCorrectionRedirection(),
|
disablePathCorrectionRedirection: disablePathCorrectionRedirection,
|
||||||
fireMethodNotAllowed: config.GetFireMethodNotAllowed(),
|
fireMethodNotAllowed: fireMethodNotAllowed,
|
||||||
enablePathIntelligence: config.GetEnablePathIntelligence(),
|
enablePathIntelligence: enablePathIntelligence,
|
||||||
forceLowercaseRouting: config.GetForceLowercaseRouting(),
|
forceLowercaseRouting: forceLowercaseRouting,
|
||||||
logger: logger,
|
logger: logger,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user