Skip to content

Commit 7b5983c

Browse files
committed
Avoid a no-attribute error in django middleware
1 parent 5f01f51 commit 7b5983c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ RUN perl -pi -e "s/ is '' / == '' /" ${AZUREROOT}_connection.py
4747
ENV OPENCENSUSINIT=/usr/local/lib/python3.11/site-packages/opencensus/common/schedule/__init__.py
4848
RUN perl -pi -e "s/logger.warning.*/pass/" ${OPENCENSUSINIT} 2>/dev/null
4949

50+
# To avoid 'NoneType' object has no attribute 'get' in clickjacking.py, 20250305:
51+
ENV CLICKJACKING=/usr/local/lib/python3.11/site-packages/django/middleware/clickjacking.py
52+
RUN perl -pi -e "s/if response.get/if response is None:\n return\n\n if response.get/" ${CLICKJACKING} 2>/dev/null
53+
54+
5055
COPY main/nginx.conf /etc/nginx/sites-available/
5156
RUN \
5257
ln -s /etc/nginx/sites-available/nginx.conf /etc/nginx/sites-enabled; \

0 commit comments

Comments
 (0)