Repository: poem-web/poem (language: rust)

Issue:
Poem erroneously includes a body chunk for HTTP 304 on HTTP/2
This causes Safari to mark the requests as failed whenever Poem is trying to return 304.

`Static/EmbedFilesEndpoint` basically stops working in Safari over HTTP/2 once the files are cached by the browser.


Discussion / hints:

Fix patch:
diff --git a/poem/src/error.rs b/poem/src/error.rs
index 05875254cb..bdbd61b67e 100644
--- a/poem/src/error.rs
+++ b/poem/src/error.rs
@@ -35,6 +35,9 @@ pub trait ResponseError {
     where
         Self: StdError + Send + Sync + 'static,
     {
+        if self.status() == StatusCode::NOT_MODIFIED {
+            return Response::builder().status(self.status()).finish();
+        }
         Response::builder()
             .status(self.status())
             .body(self.to_string())


Test patch: