From a868840132b08f5d97d954d91f56a33e1ff9139e Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 27 Sep 2022 00:41:01 +0200 Subject: [PATCH 1/2] :sparkles: Ignore S3 object metadata and use our own content-type header --- backend/src/app/http/assets.clj | 1 + docker/devenv/files/nginx.conf | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/backend/src/app/http/assets.clj b/backend/src/app/http/assets.clj index 39a55c719..65c2b8826 100644 --- a/backend/src/app/http/assets.clj +++ b/backend/src/app/http/assets.clj @@ -64,6 +64,7 @@ (yrs/response :status 307 :headers {"location" (str url) "x-host" (cond-> host port (str ":" port)) + "x-mtype" (:content-type mdata) "cache-control" (str "max-age=" (inst-ms cache-max-age))})) :fs diff --git a/docker/devenv/files/nginx.conf b/docker/devenv/files/nginx.conf index ad9b488ea..63e17e1fc 100644 --- a/docker/devenv/files/nginx.conf +++ b/docker/devenv/files/nginx.conf @@ -66,6 +66,7 @@ http { set $redirect_uri "$upstream_http_location"; set $redirect_host "$upstream_http_x_host"; set $redirect_cache_control "$upstream_http_cache_control"; + set $real_mtype "$upstream_http_x_mtype"; proxy_set_header Host "$redirect_host"; proxy_hide_header etag; @@ -75,9 +76,10 @@ http { proxy_hide_header x-amz-server-side-encryption; proxy_pass $redirect_uri; - #add_header x-internal-redirect "$redirect_uri"; - #add_header x-cache-control "$redirect_cache_control"; - #add_header cache-control "$redirect_cache_control"; + add_header x-internal-redirect "$redirect_uri"; + add_header x-cache-control "$redirect_cache_control"; + add_header cache-control "$redirect_cache_control"; + add_header content-type "$real_mtype"; } location /assets { From 4909d6574e2eb58f3bf58af61b248147b1a76a9a Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 27 Sep 2022 07:27:35 +0200 Subject: [PATCH 2/2] :paperclip: Remove unnecesary logging on ws io exception --- backend/src/app/util/websocket.clj | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/src/app/util/websocket.clj b/backend/src/app/util/websocket.clj index 4909049fe..9b6a35ab4 100644 --- a/backend/src/app/util/websocket.clj +++ b/backend/src/app/util/websocket.clj @@ -101,7 +101,8 @@ (fn [_ error] (a/close! close-ch) (when-not (or (instance? java.nio.channels.ClosedChannelException error) - (instance? java.net.SocketException error)) + (instance? java.net.SocketException error) + (instance? java.io.IOException error)) (l/error :hint (ex-message error) :cause error))) on-ws-message