K2GO-99 fix(addons): serve .cgp as octet-stream so the app downloads it - #612
Merged
Merged
Conversation
The code_addons nginx conf declared no MIME types, so nginx served .cgp
as its default text/html and the in-app WebView rendered the archive as
text instead of downloading it. Add a types{} block serving .cgp and the
source .tar.gz as application/octet-stream; the gallery's own types
(html/css/js/json/png/svg/ico) are re-declared because an nginx types{}
block replaces the inherited mime.types within the location.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Declare MIME types in the code_addons nginx conf and serve .cgp (and the
source .tar.gz) as application/octet-stream.
Why
The conf declared no types, so nginx fell back to its default_type (text/html)
for .cgp. The in-app WebView then rendered the archive as text instead of
triggering a download. An nginx types{} block replaces the inherited mime.types
inside the location, so the gallery's own types (html/css/js/json/png/svg/ico)
are re-declared next to the download types to keep the gallery rendering.
Verification
On the box: /code-addons/ serves the gallery, and tapping a card's Download
saves a valid .cgp (ZIP).
Note
The dash-node add-ons refresh re-mirrors content, not the nginx conf, so
already-deployed boxes do not self-heal this. New bakes include it.