Closed mericson-square closed 1 month ago
Websites may want to serve plain text files for well-known resources (e.g. robots.txt (RFC 9309), security.txt (RFC 9116)) but the current StaticResourceAction has no media type association for the txt extension, defaulting to application/octet-stream.
txt
application/octet-stream
This PR associates the txt extension with the existing (unused) TEXT_PLAIN_UTF8_MEDIA_TYPE so that the response includes the expected content-type: text/plain;charset=utf-8 header.
TEXT_PLAIN_UTF8_MEDIA_TYPE
content-type: text/plain;charset=utf-8
Websites may want to serve plain text files for well-known resources (e.g. robots.txt (RFC 9309), security.txt (RFC 9116)) but the current StaticResourceAction has no media type association for the
txt
extension, defaulting toapplication/octet-stream
.This PR associates the
txt
extension with the existing (unused)TEXT_PLAIN_UTF8_MEDIA_TYPE
so that the response includes the expectedcontent-type: text/plain;charset=utf-8
header.