mirror of
https://github.com/kataras/iris.git
synced 2025-02-02 15:30:36 +01:00
fix #2147
This commit is contained in:
parent
461720b842
commit
b8b96474a0
|
@ -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,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user