This commit is contained in:
Gerasimos (Makis) Maropoulos 2023-06-05 23:34:50 +03:00
parent 461720b842
commit b8b96474a0
No known key found for this signature in database
GPG Key ID: B9839E9CD30B7B6B

View File

@ -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,
} }
} }