Skip to content

Conversation

@backportbot
Copy link

@backportbot backportbot bot commented Feb 9, 2024

Backport of #11472

Warning, This backport's changes differ from the original and might be incomplete ⚠️

Todo

  • Review and resolve any conflicts
  • Amend HEAD commit to remove [skip ci] tag

Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

@backportbot backportbot bot requested review from MichaIng and icewind1991 February 9, 2024 15:24
@backportbot backportbot bot added this to the Nextcloud 27.1.7 milestone Feb 9, 2024
@MichaIng MichaIng marked this pull request as ready for review February 9, 2024 15:25
@MichaIng MichaIng marked this pull request as draft February 9, 2024 15:26
Nginx resets all response headers in a location block, if it contains any "add_header" directive. When setting the "Cache-Control" header for static assets, this was originally worked around by using the "expires" directive instead. #8083 however added the "immutable" flag for assets with "v=" query parameter and broke all other response headers for assets that way.

This commit fixes this by re-adding all reponse headers explicitly for those assets. Originally those doubled code was removed thanks to using "expires", but I see no way to have both: the "immutable" flag as well as avoiding doubled headers via "expires" directive.

Additionally, this commit avoids the trailing comma and space in the Cache-Control header for assets without "v=" query parameter, and adds sets the wasm MIME type in a cleaner/more consistent way together with js/mjs, and rephrases the broken comment sentence.

Signed-off-by: MichaIng <micha@dietpi.com>
@MichaIng MichaIng force-pushed the backport/11472/stable27 branch from bf975c3 to 3321bf2 Compare February 9, 2024 15:29
@MichaIng MichaIng marked this pull request as ready for review February 9, 2024 15:30
@MichaIng
Copy link
Member

MichaIng commented Feb 9, 2024

Conflict resolved.

@MichaIng MichaIng merged commit 9dcde98 into stable27 Feb 9, 2024
@MichaIng MichaIng deleted the backport/11472/stable27 branch February 9, 2024 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants