Skip to content

[file_server] Make suffix type mappings case-insensitive#43668

Merged
ravenblackx merged 4 commits intoenvoyproxy:mainfrom
ravenblackx:file_server_case
Mar 5, 2026
Merged

[file_server] Make suffix type mappings case-insensitive#43668
ravenblackx merged 4 commits intoenvoyproxy:mainfrom
ravenblackx:file_server_case

Conversation

@ravenblackx
Copy link
Contributor

@ravenblackx ravenblackx commented Feb 26, 2026

Commit Message: [file_server] Make suffix type mappings case-insensitive
Additional Description: Very small change to file_server, after realizing that we have an environment that serves both PNG and png files. It doesn't make much sense to have to define every combination of case for suffixes (maybe there's some Png or pnG), so making it case-insensitive makes sense.

One way to do that would be to accept any case and convert at init time - but that would provoke a confusing behavior if someone configured {"png": "image/png", "PNG": "application/octet-stream"}. We could do a deduplication validation after the fact to prevent that, but that adds a bunch of extra code for something that's trivially simple if we just enforce that it be configured in lowercase only at the proto validation level (which should be fine as a change since the filter is one day old and marked WIP).

A bonus effect of doing it this way is that protovalidate is also validating "no periods" which I previously validated in code, so that code and its test can be removed.
Risk Level: Negligible, minor change to brand new filter.
Testing: Some removed. Manually validated that the protovalidate rule is functioning as expected.
Docs Changes: n/a
Release Notes: Added previously-forgotten changelog.
Platform Specific Features: n/a

Signed-off-by: Raven Black <ravenblack@dropbox.com>
@repokitteh-read-only
Copy link

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to (api/envoy/|docs/root/api-docs/).
envoyproxy/api-shepherds assignee is @wbpcode
CC @envoyproxy/api-watchers: FYI only for changes made to (api/envoy/|docs/root/api-docs/).

🐱

Caused by: #43668 was opened by ravenblackx.

see: more, trace.

Signed-off-by: Raven Black <ravenblack@dropbox.com>
Signed-off-by: Raven Black <ravenblack@dropbox.com>
phlax
phlax previously approved these changes Feb 26, 2026
Copy link
Member

@phlax phlax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks @ravenblackx

@ravenblackx ravenblackx enabled auto-merge (squash) February 26, 2026 22:23
Signed-off-by: Raven Black <ravenblack@dropbox.com>
@ravenblackx ravenblackx merged commit ebe283c into envoyproxy:main Mar 5, 2026
28 of 29 checks passed
@repokitteh-read-only repokitteh-read-only bot removed the api label Mar 5, 2026
@ravenblackx ravenblackx deleted the file_server_case branch March 5, 2026 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants