Skip to content

Commit

Permalink
[deps] Pinned "django-cors-headers~=4.4.0" #480
Browse files Browse the repository at this point in the history
Dropped support for "openwisp2_django_cors.replace_https_referer"

Closes #480
setting.
  • Loading branch information
pandafy committed Nov 25, 2024
1 parent 4d0499b commit d30ad3f
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 13 deletions.
1 change: 0 additions & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ cron_delete_inactive_users: "'hour': 1, 'minute': 55"
openwisp2_django_cors:
enabled: false
allowed_origins_list: []
replace_https_referer: false
openwisp2_extra_supervisor_restart: []
openwisp2_usage_metric_collection: null
# allow disabling celery beat tasks if needed
Expand Down
1 change: 0 additions & 1 deletion docs/user/configuring-cors-headers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ setting of ``django-cors-headers`` as shown in the following example:
allowed_origins_list:
- https://frontend.openwisp.org
- https://logs.openwisp.org
replace_https_referer: true
# Configuring additional settings for django-cors-headers
openwisp2_extra_django_settings_instructions:
- |
Expand Down
6 changes: 0 additions & 6 deletions docs/user/role-variables.rst
Original file line number Diff line number Diff line change
Expand Up @@ -455,12 +455,6 @@ take a look at `the default values of these variables
# HTTP requests. Read https://github.com/adamchainz/django-cors-headers#cors_allowed_origins-sequencestr
# for detail. By default, it is set to an empty list.
allowed_origins_list: ["https://log.openwisp.org"]
# Configures "CORS_REPLACE_HTTPS_REFERER" setting of the django-cors-headers
# package. Read https://github.com/adamchainz/django-cors-headers#cors_replace_https_referer-bool
# for detail. Setting this to "true" will also configure the
# Django middleware setting to add "CorsPostCsrfMiddleware".
# By default, it is set to false.
replace_https_referer: true
.. note::

Expand Down
2 changes: 1 addition & 1 deletion tasks/pip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
- name: Install django-cors-headers
when: openwisp2_django_cors.get('enabled')
pip:
name: django-cors-headers
name: "django-cors-headers~=4.4.0"
state: latest
virtualenv: "{{ virtualenv_path }}"
virtualenv_python: "{{ openwisp2_python }}"
Expand Down
4 changes: 0 additions & 4 deletions templates/openwisp2/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,10 +562,6 @@
# CORS configuration
INSTALLED_APPS.append('corsheaders')
MIDDLEWARE.insert(MIDDLEWARE.index('django.middleware.common.CommonMiddleware'), 'corsheaders.middleware.CorsMiddleware')
{% if openwisp2_django_cors.get('replace_https_referer', False) %}
MIDDLEWARE.insert(MIDDLEWARE.index('django.middleware.csrf.CsrfViewMiddleware') + 1, 'corsheaders.middleware.CorsPostCsrfMiddleware')
CORS_REPLACE_HTTPS_REFERER = {{ openwisp2_django_cors.get('replace_https_referer', False) }}
{% endif %}
CORS_ALLOWED_ORIGINS = {{ openwisp2_django_cors.get('allowed_origins_list', []) }}
{% endif %}

Expand Down

0 comments on commit d30ad3f

Please sign in to comment.