Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix incorrectContent-Encoding for pre-compressed Zstd file requests#452

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

joseluisq
Copy link
Collaborator

Description

This PR fixes an issue when performing file requests with theAccept-Encoding: zstd header and getting an incorrectContent-Encoding header value for Zstd files if enabling thecompression-static feature.

Then incorrectContent-Encoding header value waszst (extension) rather thanzstd (encoding).

Related Issue

Fixes#451

Motivation and Context

How Has This Been Tested?

The server will reply as expected.

$ docker run --rm joseluisq/alpine-curl curl -s -i -v -H"Accept-Encoding: zstd" --compressed http://100.100.1.100:8787/# * processing: http://100.100.1.100:8787/# *   Trying 100.100.1.100:8787...# * Connected to 100.100.1.100 (100.100.1.100) port 8787# > GET / HTTP/1.1# > Host: 100.100.1.100:8787# > User-Agent: curl/8.2.0# > Accept: */*> Accept-Encoding: zstd# ># HTTP/1.1 200 OK# < HTTP/1.1 200 OK# < vary: accept-encoding# < content-type: text/html# < accept-ranges: bytes# < last-modified: Wed, 22 May 2024 22:43:10 GMT< content-encoding: zstd# < cache-control: public, max-age=86400# < transfer-encoding: chunked# < date: Wed, 29 May 2024 04:16:24 GMT# <# { [357 bytes data]# * Connection #0 to host 100.100.1.100 left intact# vary: accept-encoding# content-type: text/html# accept-ranges: bytes# last-modified: Wed, 22 May 2024 22:43:10 GMTcontent-encoding: zstd# cache-control: public, max-age=86400# transfer-encoding: chunked# date: Wed, 29 May 2024 04:16:24 GMT# <!DOCTYPE html># <html lang="en"># <head>#     <meta charset="utf-8">#     <title>Static Web Server</title>#     <link rel="stylesheet" href="/assets/main.css">#     <link rel="shortcut icon" href="/assets/favicon.ico"># </head># <body>#     <h1>Static Web Server</h1>#     <p>A cross-platform, high-performance and asynchronous web server for static files-serving. ⚡</p>#     <p><a href="https://github.com/static-web-server/static-web-server/">View on GitHub</a></p>#     <script src="/assets/main.js"></script># </body># </html>

Screenshots (if appropriate):

@joseluisqjoseluisq added v2v2 release bugfixThis is PR fixes a bug labelsMay 29, 2024
@joseluisqjoseluisq self-assigned thisMay 29, 2024
@semanticdiff-comSemanticDiff.com
Copy link

semanticdiff-combot commentedMay 29, 2024
edited
Loading

Review changes withSemanticDiff.

Analyzed 5 of 6 files.

Overall, the semantic diff is3% smaller than the GitHub diff.

FilenameStatus
✔️src/compression_static.rsAnalyzed
✔️src/fs/meta.rsAnalyzed
✔️src/static_files.rs17.07% smaller
✔️tests/compression_static.rsAnalyzed
✔️tests/dir_listing.rsAnalyzed
tests/fixtures/public/main.js.zstUnsupported file format

@joseluisqjoseluisq added this to thev2.31.2 milestoneMay 29, 2024
@joseluisqjoseluisq merged commit6031a1b intomasterMay 29, 2024
@joseluisqjoseluisq deleted the fix-wrong-accept-encondig-zstd-pre-compressed branchMay 29, 2024 04:53
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees

@joseluisqjoseluisq

Labels
bugfixThis is PR fixes a bugv2v2 release
Projects
None yet
Milestone
v2.32.0
Development

Successfully merging this pull request may close these issues.

Incorrect Content-Encoding for pre-compressed zstd files
1 participant
@joseluisq

[8]ページ先頭

©2009-2025 Movatter.jp