mirror of
https://github.com/kataras/iris.git
synced 2025-02-02 07:20:35 +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
|
||||
// to map the request with a route (aka mux implementation).
|
||||
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{
|
||||
disablePathCorrection: config.GetDisablePathCorrection(),
|
||||
disablePathCorrectionRedirection: config.GetDisablePathCorrectionRedirection(),
|
||||
fireMethodNotAllowed: config.GetFireMethodNotAllowed(),
|
||||
enablePathIntelligence: config.GetEnablePathIntelligence(),
|
||||
forceLowercaseRouting: config.GetForceLowercaseRouting(),
|
||||
disablePathCorrection: disablePathCorrection,
|
||||
disablePathCorrectionRedirection: disablePathCorrectionRedirection,
|
||||
fireMethodNotAllowed: fireMethodNotAllowed,
|
||||
enablePathIntelligence: enablePathIntelligence,
|
||||
forceLowercaseRouting: forceLowercaseRouting,
|
||||
logger: logger,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user