index : static-web-server.git

ascending towards madness

author Jose Quintana <joseluisquintana20@gmail.com> 2021-07-02 13:58:25.0 +00:00:00
committer Jose Quintana <joseluisquintana20@gmail.com> 2021-07-02 13:58:25.0 +00:00:00
commit
0ed62870245f5687db62c5b1d5b718865298d704 [patch]
tree
f9b97d65230f840f4de070c0d5534c9374d8eeae
parent
a1b78366eed0bf97516b745964d2183be02a13b9
download
0ed62870245f5687db62c5b1d5b718865298d704.tar.gz

refactor: auto compression error result log



Diff

 src/handler.rs | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/handler.rs b/src/handler.rs
index 7909b3c..f3b06d3 100644
--- a/src/handler.rs
+++ b/src/handler.rs
@@ -52,7 +52,16 @@ impl RequestHandler {
                Ok(mut resp) => {
                    // Auto compression based on the `Accept-Encoding` header
                    if self.opts.compression {
                        resp = compression::auto(method, headers, resp)?;
                        resp = match compression::auto(method, headers, resp) {
                            Ok(res) => res,
                            Err(err) => {
                                tracing::debug!("error during body compression: {:?}", err);
                                return error_page::error_response(
                                    method,
                                    &StatusCode::INTERNAL_SERVER_ERROR,
                                );
                            }
                        };
                    }

                    // Append `Cache-Control` headers for web assets