Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS misreads comments in mime.types files. #379

Open
Rombobeorn opened this issue Aug 13, 2024 · 1 comment
Open

AWS misreads comments in mime.types files. #379

Rombobeorn opened this issue Aug 13, 2024 · 1 comment

Comments

@Rombobeorn
Copy link

AWS.MIME.Load is supposed to read "the common standard format used by Apache mime.types", according to the comment in aws-mime.ads. That format includes comments that programs are supposed to ignore. AWS.MIME.Load reads the comments as a content type called "#" with many associated filename suffixes.

Here's a simple reproducer:

with AWS.MIME, Ada.Text_IO;
procedure Reproducer is
   Example : constant String := "filename.is";
begin
   AWS.MIME.Load("/etc/mime.types");
   Ada.Text_IO.Put_Line('"' & Example & """ translates to """ &
                        AWS.MIME.Content_Type(Example) & """.");
end Reproducer;

Let the reproducer read the mime.types distributed with Apache HTTPD, or one of the copies distributed with AWS, or /etc/mime.types in the mailcap package in Fedora, RHEL and others, or /etc/mime.types in the media-types package in Debian. All of them contain the word "is", so the output will be:

"filename.is" translates to "#".

Correct output would be:

"filename.is" translates to "application/octet-stream".

@Rombobeorn
Copy link
Author

Here's the patch I'm applying in Fedora:

https://src.fedoraproject.org/rpms/aws/blob/rawhide/f/aws-mime-types-comments.patch

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

No branches or pull requests

1 participant