Repository navigation
Conversation
Fix document MIME type resolution
# Conflicts: # handlers.go
chore: sync with upstream asternic/wuzapi
main carried an earlier implementation of the same fix in handlers.go. The version in upstream PR asternic#374 is better: it lives in media_sources.go where upstream refactored the media path, and it carries an explicit extension table so OpenDocument files resolve correctly - Go's builtin MIME map omits .odt/.ods/.odp and the slim runtime image ships no media-types package, so main still sent those as application/zip. Keeping two divergent fixes for one bug guarantees a conflict. This makes the fork's diff against upstream exactly PR asternic#374, so if that lands the fork has no diff at all. The new workflow runs go test, which nothing did before: upstream's 'Build and Test' runs vet and build only.
Contributor
Author
|
Opened against the wrong repository by mistake |
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.
Two changes, both aimed at the fork eventually disappearing.
Adopt PR #374's implementation
maincarried an earlier version of the document MIME-type fix inhandlers.go. Upstream#374 has a better one, and this branch adopts it
wholesale.
mainbeforehandlers.gomedia_sources.go, where upstream refactored the media pathmime.TypeByExtension.odt/.ods/.odpThat last row is not theoretical. Go's builtin MIME map covers
.xlsx,.docxand.pptxbutomits OpenDocument, and
Dockerfileinstalls nomedia-typespackage — so in the runtime imagemainstill sent those asapplication/zip. The PR's own comment says exactly this: "so thelookup does not depend on the host MIME database, which slim images do not ship."
The diff against upstream is now exactly #374 — 5 files, +72/-13, matching the PR's own stats.
So if #374 merges, this fork's diff becomes nothing and the fork can be deleted. Carrying two
divergent fixes for one bug guaranteed a conflict instead.
The postman-collection tweak is dropped for the same reason: useful, but not part of #374, and it
would have kept a permanent diff. Worth folding into the PR itself.
Publish to GHCR, and actually run the tests
publish.ymlbuildsghcr.io/gijsmin/wuzapion a version tag, for the 87w home server to pull.linux/amd64only — the server is an N100, and upstream's arm64 build means QEMU emulation underCGO_ENABLED=1.It also runs
go test ./..., which nothing did before. Upstream's workflow is named "Build andTest" but its steps are
go vetandgo build; the onlytestin the file is the name. The MIMEtests had therefore never executed. They now run on every push and gate the image.
Deliberately not touched:
build.ymlanddocker-publish.yml. Both are byte-identical toupstream, and editing either would create a conflict on every future sync.
docker-publish.ymlcan never fire here anyway — it pushes to
asternic/wuzapiwith Docker Hub secrets this fork doesnot have, triggered by a published release this fork does not create.