Skip to content

Ensure Content-Type is always provided for js modules#2014

Merged
Lord-Grey merged 2 commits into
hyperion-project:masterfrom
Lord-Grey:#1999
May 14, 2026
Merged

Ensure Content-Type is always provided for js modules#2014
Lord-Grey merged 2 commits into
hyperion-project:masterfrom
Lord-Grey:#1999

Conversation

@Lord-Grey
Copy link
Copy Markdown
Collaborator

Summary

🔧 Changed

  • Fixes:
    • WebUI - Return a valid Content-Type for static assets to prevent module loading failures

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Docs
  • Build-related changes
  • Other, please describe:

If changing the UI of web configuration, please provide the before/after screenshot:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing setups:

The PR fulfills these requirements:

  • When resolving a specific issue, it's referenced in the PR's body (e.g. Fixes: #xxx[,#xxx], where "xxx" is the issue number)

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature
  • Related documents have been updated (docs/docs/en)
  • Related tests have been updated

PLEASE DON'T FORGET TO ADD YOUR CHANGES TO CHANGELOG.MD

  • Yes, CHANGELOG.md is also updated

To avoid wasting your time, it's best to open a feature request issue first and wait for approval before working on it.

Other information:
Fixes: #1999

@Lord-Grey Lord-Grey self-assigned this May 14, 2026
Copilot AI review requested due to automatic review settings May 14, 2026 09:19
@Lord-Grey Lord-Grey added this to Web UI May 14, 2026
@hyperion-project
Copy link
Copy Markdown

Hello @Lord-Grey 👋

I'm the Hyperion Project Bot and I want to thank you for
contributing to Hyperion with your pull requests!

To help you and other users test your pull requests faster,
I'll create a link for you to your workflow artifacts.

🔗 https://github.com/hyperion-project/hyperion.ng/actions/runs/25852229128

Of course, if you make changes to your PR, I will create a new link.

Best regards,
Hyperion Project

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes a WebUI bug where static JavaScript modules were served without a valid Content-Type header, causing browsers to block them due to disallowed MIME type. The fix introduces a helper that falls back to text/javascript for .js/.mjs/.cjs files (and application/octet-stream otherwise) when QMimeDatabase fails to resolve a usable MIME type, while preserving the existing QTBUG-97392 workaround for HTML files.

Changes:

  • Extracted MIME resolution into a resolveMimeType helper with JS extension fallback and default application/octet-stream.
  • Narrowed the QTBUG-97392 HTML workaround to only the affected Qt version ranges.
  • Updated CHANGELOG.md with the fix entry and corrected a typo on the prior line.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
libsrc/webserver/StaticFileServing.cpp Adds resolveMimeType helper providing fallback Content-Type for JS modules and unknown types.
CHANGELOG.md Adds changelog entry for the fix and corrects "incomptible" → "incompatible".

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Lord-Grey Lord-Grey merged commit bb08c7f into hyperion-project:master May 14, 2026
26 checks passed
@github-project-automation github-project-automation Bot moved this to Done in Web UI May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Bug Report — Philips Hue Wizard not working in 2.2.0

2 participants