Skip to content

Commit

Permalink
expose headers for CORS requests
Browse files Browse the repository at this point in the history
use Access-Control-Expose-Headers with Location, Content-Disposition, Cache-Control and Content-Encoding
so these response headers can appear in the response of a CORS request
fix elabftw/elabftw#5006
  • Loading branch information
NicolasCARPi committed Mar 22, 2024
1 parent bccabb0 commit cd99861
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Container image version
# Note: the version here is from `ELABIMG_VERSION` present in Dockerfile, not the tagged one

# 5.1.0

* Add Access-Control-Expose-Headers with Location, Content-Disposition, Cache-Control and Content-Encoding

# 5.0.2

* Fix issue with messages being logged two times (error log)
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ RUN abuild-keygen -n -a && abuild && find /home/builder/packages -type f -name '
FROM alpine:3.18

# this is versioning for the container image
ENV ELABIMG_VERSION=5.0.2
ENV ELABIMG_VERSION=5.1.0

# the target elabftw version is passed with --build-arg
# it is a mandatory ARG
Expand Down
3 changes: 3 additions & 0 deletions src/nginx/common.conf
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,6 @@ more_set_headers "Server: %SERVER_HEADER%";
%ACAH_HEADER%
# this one is only used for CORS but let's leave it there, it doesn't hurt
more_set_headers "Access-Control-Allow-Credentials: true";
# this one is only used for CORS, we might make it user configurable if necessary, but it makes sense to hard code what we have and want to expose
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Expose-Headers
more_set_headers "Access-Control-Expose-Headers: Location, Content-Encoding, Content-Disposition, Cache-Control";

0 comments on commit cd99861

Please sign in to comment.