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

Check JavaScript files content type. #1802

Merged
merged 3 commits into from Jul 4, 2023

Conversation

tim-schilling
Copy link
Contributor

A common problem with windows set ups is that the registry is misconfigured when resolving the content type for a JavaScript file. This check captures this sooner to explain why the toolbar doesn't show and attempts to tell the user what to change to make it work.

Fixes #1764

Checklist:

  • I have added the relevant tests for this change.
  • I have added an item to the Pending section of docs/changes.rst.

Check that JavaScript files are resolving to the correct content type.
"""
javascript_types = {
# Macs
Copy link
Member

Choose a reason for hiding this comment

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

Maybe Linux, macOS ? Or Unices ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This section confuses me. I put those comments there because on my mac, I found that mimetypes was returning application/javascript, but the windows solution was to use text/javascript.

I couldn't reproduce what windows users would actually experience for this. Or at least not easily.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I installed python on my windows machine, which was easier than expected. We should check for text/javascript, but we should recommend that users use a value of application/javascript instead. I'll clean this up to reflect that.

debug_toolbar/apps.py Outdated Show resolved Hide resolved
tim-schilling and others added 3 commits July 3, 2023 19:15
A common problem with windows set ups is that the registry is
misconfigured when resolving the content type for a JavaScript
file. This check captures this sooner to explain why the toolbar
doesn't show and attempts to tell the user what to change to make
it work.
Co-authored-by: Matthias Kestenholz <mk@feinheit.ch>
@tim-schilling
Copy link
Contributor Author

@matthiask alright, if you're okay with the latest changes let's merge them.

@matthiask matthiask merged commit 4a641ec into jazzband:main Jul 4, 2023
21 checks passed
@matthiask
Copy link
Member

Yes, thank you!

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.

Create a system check that determines if mimetypes issue exists
2 participants