Skip to content

Inconsistencies in Content-Type returned for /readme.txt #1127

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

Closed
Kleidukos opened this issue Aug 22, 2022 · 2 comments · Fixed by #1133
Closed

Inconsistencies in Content-Type returned for /readme.txt #1127

Kleidukos opened this issue Aug 22, 2022 · 2 comments · Fixed by #1133

Comments

@Kleidukos
Copy link
Member

Some package have their /readme.txt content returned as text/plain; charset=utf-8, like text-show, and others have the content type set as text/plain, like cpsa.

I have two questions:

  1. Where would this difference come from;
  2. Couldn't we force all .txt files to be sent as text/plain; charset=utf-8?

Cheers

@gbaz
Copy link
Contributor

gbaz commented Aug 25, 2022

mime matching is done here:

txt falls through to the mimeTypes map from happstack, which should be just "text/plain" -- for some reason one of those readmes doesn't match that (not sure why!) so we get the default which also has the utf8.

We could add "txt" and "text" directly to customMimeTypes to override them and always ensure the utf8. A pr doing so would be welcome.

@Kleidukos
Copy link
Member Author

Got it!

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 a pull request may close this issue.

2 participants