-
Notifications
You must be signed in to change notification settings - Fork 413
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(django): recreate response stream to prevent reading from empty r…
…esponse body [backport 2.10] (#10208) Fixes customer escalation. Customer was using the [Spyne library](https://github.com/arskom/spyne) with Django and making SOAP requests towards it. The problem was found to be that Django integration was reading the response body to set some span tags. However, later in the callstack, Spyne also tries to read the response body (now empty since the stream was fully read). This PR copies/recreates the response body to prevent this error. (cherry picked from commit 20b8c2b) ## Checklist - [x] PR author has checked that all the criteria below are met - The PR description includes an overview of the change - The PR description articulates the motivation for the change - The change includes tests OR the PR description describes a testing strategy - The PR description notes risks associated with the change, if any - Newly-added code is easy to change - The change follows the [library release note guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html) - The change includes or references documentation updates if necessary - Backport labels are set (if [applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)) ## Reviewer Checklist - [x] Reviewer has checked that all the criteria below are met - Title is accurate - All changes are related to the pull request's stated goal - Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes - Testing strategy adequately addresses listed risks - Newly-added code is easy to change - Release note makes sense to a user of the library - If necessary, author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment - Backport labels are set in a manner that is consistent with the [release branch maintenance policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)
- Loading branch information
Showing
27 changed files
with
736 additions
and
499 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# | ||
# This file is autogenerated by pip-compile with Python 3.12 | ||
# by the following command: | ||
# | ||
# pip-compile --allow-unsafe --no-annotate .riot/requirements/12e2ec4.in | ||
# | ||
arrow==1.3.0 | ||
asgiref==3.8.1 | ||
attrs==24.2.0 | ||
autobahn==24.4.2 | ||
automat==22.10.0 | ||
blessed==1.20.0 | ||
certifi==2024.7.4 | ||
cffi==1.17.0 | ||
channels==4.1.0 | ||
charset-normalizer==3.3.2 | ||
constantly==23.10.4 | ||
coverage[toml]==7.6.1 | ||
cryptography==43.0.0 | ||
daphne==4.1.2 | ||
django==4.2.15 | ||
django-picklefield==3.2 | ||
django-pylibmc==0.6.1 | ||
django-q==1.3.6 | ||
django-redis==4.5.0 | ||
hyperlink==21.0.0 | ||
hypothesis==6.45.0 | ||
idna==3.7 | ||
incremental==24.7.2 | ||
iniconfig==2.0.0 | ||
isodate==0.6.1 | ||
lxml==5.3.0 | ||
mock==5.1.0 | ||
opentracing==2.4.0 | ||
packaging==24.1 | ||
platformdirs==4.2.2 | ||
pluggy==1.5.0 | ||
psycopg==3.2.1 | ||
psycopg2-binary==2.9.9 | ||
pyasn1==0.6.0 | ||
pyasn1-modules==0.4.0 | ||
pycparser==2.22 | ||
pylibmc==1.6.3 | ||
pyopenssl==24.2.1 | ||
pytest==8.3.2 | ||
pytest-cov==5.0.0 | ||
pytest-django==3.10.0 | ||
pytest-mock==3.14.0 | ||
pytest-randomly==3.15.0 | ||
python-dateutil==2.9.0.post0 | ||
python-memcached==1.62 | ||
pytz==2024.1 | ||
redis==2.10.6 | ||
requests==2.32.3 | ||
requests-file==2.1.0 | ||
requests-toolbelt==1.0.0 | ||
service-identity==24.1.0 | ||
six==1.16.0 | ||
sortedcontainers==2.4.0 | ||
spyne==2.14.0 | ||
sqlparse==0.5.1 | ||
twisted[tls]==24.7.0 | ||
txaio==23.1.1 | ||
types-python-dateutil==2.9.0.20240316 | ||
typing-extensions==4.12.2 | ||
urllib3==2.2.2 | ||
wcwidth==0.2.13 | ||
zeep==4.2.1 | ||
zope-interface==7.0.1 | ||
|
||
# The following packages are considered to be unsafe in a requirements file: | ||
setuptools==72.2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# | ||
# This file is autogenerated by pip-compile with Python 3.10 | ||
# by the following command: | ||
# | ||
# pip-compile --allow-unsafe --no-annotate .riot/requirements/138818b.in | ||
# | ||
arrow==1.3.0 | ||
asgiref==3.8.1 | ||
attrs==24.2.0 | ||
autobahn==24.4.2 | ||
automat==22.10.0 | ||
blessed==1.20.0 | ||
certifi==2024.7.4 | ||
cffi==1.17.0 | ||
channels==4.1.0 | ||
charset-normalizer==3.3.2 | ||
constantly==23.10.4 | ||
coverage[toml]==7.6.1 | ||
cryptography==43.0.0 | ||
daphne==4.1.2 | ||
django==4.2.15 | ||
django-picklefield==3.2 | ||
django-pylibmc==0.6.1 | ||
django-q==1.3.6 | ||
django-redis==4.5.0 | ||
exceptiongroup==1.2.2 | ||
hyperlink==21.0.0 | ||
hypothesis==6.45.0 | ||
idna==3.7 | ||
incremental==24.7.2 | ||
iniconfig==2.0.0 | ||
isodate==0.6.1 | ||
lxml==5.3.0 | ||
mock==5.1.0 | ||
opentracing==2.4.0 | ||
packaging==24.1 | ||
platformdirs==4.2.2 | ||
pluggy==1.5.0 | ||
psycopg==3.2.1 | ||
psycopg2-binary==2.9.9 | ||
pyasn1==0.6.0 | ||
pyasn1-modules==0.4.0 | ||
pycparser==2.22 | ||
pylibmc==1.6.3 | ||
pyopenssl==24.2.1 | ||
pytest==8.3.2 | ||
pytest-cov==5.0.0 | ||
pytest-django==3.10.0 | ||
pytest-mock==3.14.0 | ||
pytest-randomly==3.15.0 | ||
python-dateutil==2.9.0.post0 | ||
python-memcached==1.62 | ||
pytz==2024.1 | ||
redis==2.10.6 | ||
requests==2.32.3 | ||
requests-file==2.1.0 | ||
requests-toolbelt==1.0.0 | ||
service-identity==24.1.0 | ||
six==1.16.0 | ||
sortedcontainers==2.4.0 | ||
spyne==2.14.0 | ||
sqlparse==0.5.1 | ||
tomli==2.0.1 | ||
twisted[tls]==24.7.0 | ||
txaio==23.1.1 | ||
types-python-dateutil==2.9.0.20240316 | ||
typing-extensions==4.12.2 | ||
urllib3==2.2.2 | ||
wcwidth==0.2.13 | ||
zeep==4.2.1 | ||
zope-interface==7.0.1 | ||
|
||
# The following packages are considered to be unsafe in a requirements file: | ||
setuptools==72.2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# | ||
# This file is autogenerated by pip-compile with Python 3.8 | ||
# by the following command: | ||
# | ||
# pip-compile --allow-unsafe --no-annotate --resolver=backtracking .riot/requirements/173d698.in | ||
# | ||
arrow==1.3.0 | ||
asgiref==3.8.1 | ||
attrs==24.2.0 | ||
autobahn==23.1.2 | ||
automat==22.10.0 | ||
backports-zoneinfo==0.2.1 | ||
blessed==1.20.0 | ||
certifi==2024.7.4 | ||
cffi==1.17.0 | ||
channels==4.1.0 | ||
charset-normalizer==3.3.2 | ||
constantly==23.10.4 | ||
coverage[toml]==7.6.1 | ||
cryptography==43.0.0 | ||
daphne==4.1.2 | ||
django==4.2.15 | ||
django-picklefield==3.2 | ||
django-pylibmc==0.6.1 | ||
django-q==1.3.6 | ||
django-redis==4.5.0 | ||
exceptiongroup==1.2.2 | ||
hyperlink==21.0.0 | ||
hypothesis==6.45.0 | ||
idna==3.7 | ||
importlib-metadata==8.2.0 | ||
incremental==24.7.2 | ||
iniconfig==2.0.0 | ||
isodate==0.6.1 | ||
lxml==5.3.0 | ||
mock==5.1.0 | ||
opentracing==2.4.0 | ||
packaging==24.1 | ||
platformdirs==4.2.2 | ||
pluggy==1.5.0 | ||
psycopg2-binary==2.9.9 | ||
pyasn1==0.6.0 | ||
pyasn1-modules==0.4.0 | ||
pycparser==2.22 | ||
pylibmc==1.6.3 | ||
pyopenssl==24.2.1 | ||
pytest==8.3.2 | ||
pytest-cov==5.0.0 | ||
pytest-django==3.10.0 | ||
pytest-mock==3.14.0 | ||
pytest-randomly==3.15.0 | ||
python-dateutil==2.9.0.post0 | ||
python-memcached==1.62 | ||
pytz==2024.1 | ||
redis==2.10.6 | ||
requests==2.32.3 | ||
requests-file==2.1.0 | ||
requests-toolbelt==1.0.0 | ||
service-identity==24.1.0 | ||
six==1.16.0 | ||
sortedcontainers==2.4.0 | ||
spyne==2.14.0 | ||
sqlparse==0.5.1 | ||
tomli==2.0.1 | ||
twisted[tls]==24.7.0 | ||
txaio==23.1.1 | ||
types-python-dateutil==2.9.0.20240316 | ||
typing-extensions==4.12.2 | ||
urllib3==2.2.2 | ||
wcwidth==0.2.13 | ||
zeep==4.2.1 | ||
zipp==3.20.0 | ||
zope-interface==7.0.1 | ||
|
||
# The following packages are considered to be unsafe in a requirements file: | ||
setuptools==72.2.0 |
Oops, something went wrong.