Follow-up from "feat: make _redirects limits configurable"
The following discussions from !778 (merged) should be addressed:
-
@vtak started a discussion: (+4 comments) blocking
Instead of down-sizing
fi.Size()by applyingintover it, let us rather useint64oncfg.MaxConfigSizeif fi.Size() > int64(cfg.MaxConfigSize) {
I wonder if we should be defining the flag as
redirectsMaxConfigSize = flag.Int64(...)instead ofredirectsMaxConfigSize = flag.Int(...)....
...
Since
redirectsMaxConfigSizerepresentsThe maximum size of the _redirects file, in bytes, keepingredirectsMaxConfigSize = flag.Int(...)would mean that there is a scenario where the file size can be higher than the maximum value ofinttype (sincefi.Size()returnsint64) and the only reason why it wouldn't work properly is because we wouldn't be able to pass a higher value inredirectsMaxConfigSize