Commit a7eb3cb3 authored by Hardik Juneja's avatar Hardik Juneja Committed by Rafael Monnerat

Modify apache config files to set headers on failure (4xx for example) and on sucess (2xx) as well

/reviewed-on nexedi/slapos!117
parent 1d0a8073
...@@ -125,7 +125,7 @@ recipe = hexagonit.recipe.download ...@@ -125,7 +125,7 @@ recipe = hexagonit.recipe.download
ignore-existing = true ignore-existing = true
url = ${:_profile_base_location_}/httpd_conf.in url = ${:_profile_base_location_}/httpd_conf.in
download-only = true download-only = true
md5sum = 2e8440fa4b589be649a72108faec7745 md5sum = 112cf8ada9e5c4172fa6fc464df0fd3a
filename = httpd_conf.in filename = httpd_conf.in
mode = 0644 mode = 0644
......
...@@ -50,9 +50,6 @@ SSLHonorCipherOrder on ...@@ -50,9 +50,6 @@ SSLHonorCipherOrder on
SSLEngine On SSLEngine On
Include {{ parameters.httpd_cors_file }} Include {{ parameters.httpd_cors_file }}
Header set Access-Control-Allow-Credentials "true"
Header set Access-Control-Allow-Methods "PROPFIND, PROPPATCH, COPY, MOVE, DELETE, MKCOL, LOCK, UNLOCK, PUT, GETLIB, VERSION-CONTROL, CHECKIN, CHECKOUT, UNCHECKOUT, REPORT, UPDATE, CANCELUPLOAD, HEAD, OPTIONS, GET, POST"
Header set Access-Control-Allow-Headers "Overwrite, Destination, Content-Type, Depth, User-Agent, X-File-Size, X-Requested-With, If-Modified-Since, X-File-Name, Cache-Control, Authorization"
DocumentRoot {{ parameters.runner_home }}/public DocumentRoot {{ parameters.runner_home }}/public
......
...@@ -62,7 +62,7 @@ eggs = ...@@ -62,7 +62,7 @@ eggs =
# Monitor templates files # Monitor templates files
[monitor-httpd-conf] [monitor-httpd-conf]
<= monitor-template-base <= monitor-template-base
md5sum = 40dc51fc156f1ad7eb94be7f3cbf08b4 md5sum = f2d6951670733de3b37c0ebe9eee343b
filename = monitor-httpd.conf.in filename = monitor-httpd.conf.in
[monitor-template-wrapper] [monitor-template-wrapper]
...@@ -83,7 +83,7 @@ md5sum = 1bdb4e05c6be04f4e5766c64467fbcec ...@@ -83,7 +83,7 @@ md5sum = 1bdb4e05c6be04f4e5766c64467fbcec
[monitor-httpd-cors] [monitor-httpd-cors]
<= monitor-template-base <= monitor-template-base
filename = httpd-cors.cfg.in filename = httpd-cors.cfg.in
md5sum = 5afad2bb6e088e080e907f1d837effbb md5sum = 683ea85fc054094248baf5752dd089bf
# End templates files # End templates files
# XXX keep compatibility (with software/ipython_notebook/software.cfg ) # XXX keep compatibility (with software/ipython_notebook/software.cfg )
......
...@@ -2,4 +2,7 @@ ...@@ -2,4 +2,7 @@
{% set allow_domain = '|'.join(domain.replace('.', '\.').split()) -%} {% set allow_domain = '|'.join(domain.replace('.', '\.').split()) -%}
SetEnvIf Origin "^http(s)?://(.+\.)?({{ allow_domain }})$" ORIGIN_DOMAIN=$0 SetEnvIf Origin "^http(s)?://(.+\.)?({{ allow_domain }})$" ORIGIN_DOMAIN=$0
Header always set Access-Control-Allow-Origin "%{ORIGIN_DOMAIN}e" env=ORIGIN_DOMAIN Header always set Access-Control-Allow-Origin "%{ORIGIN_DOMAIN}e" env=ORIGIN_DOMAIN
{% endif -%} Header always set Access-Control-Allow-Credentials "true" env=ORIGIN_DOMAIN
\ No newline at end of file Header always set Access-Control-Allow-Methods "PROPFIND, PROPPATCH, COPY, MOVE, DELETE, MKCOL, LOCK, UNLOCK, PUT, GETLIB, VERSION-CONTROL, CHECKIN, CHECKOUT, UNCHECKOUT, REPORT, UPDATE, CANCELUPLOAD, HEAD, OPTIONS, GET, POST" env=ORIGIN_DOMAIN
Header always set Access-Control-Allow-Headers "Overwrite, Destination, Content-Type, Depth, User-Agent, X-File-Size, X-Requested-With, If-Modified-Since, X-File-Name, Cache-Control, Authorization" env=ORIGIN_DOMAIN
{% endif -%}
...@@ -56,9 +56,6 @@ Include {{ parameter_dict.get('httpd-cors-config-file') }} ...@@ -56,9 +56,6 @@ Include {{ parameter_dict.get('httpd-cors-config-file') }}
Header set Vary Origin Header set Vary Origin
Header set Cache-Control "private, max-age=40" Header set Cache-Control "private, max-age=40"
Header set Access-Control-Max-Age "40" Header set Access-Control-Max-Age "40"
Header set Access-Control-Allow-Credentials "true"
Header set Access-Control-Allow-Methods "PROPFIND, PROPPATCH, COPY, MOVE, DELETE, MKCOL, LOCK, UNLOCK, PUT, GETLIB, VERSION-CONTROL, CHECKIN, CHECKOUT, UNCHECKOUT, REPORT, UPDATE, CANCELUPLOAD, HEAD, OPTIONS, GET, POST"
Header set Access-Control-Allow-Headers "Overwrite, Destination, Content-Type, Depth, User-Agent, X-File-Size, X-Requested-With, If-Modified-Since, X-File-Name, Cache-Control, Authorization"
DavLockDB {{ directory.get('monitor-var') }}/DavLock DavLockDB {{ directory.get('monitor-var') }}/DavLock
Alias /share {{ directory.get('webdav') }} Alias /share {{ directory.get('webdav') }}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment