Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
0.25.8
------

* Fix bug where the content type is always recorded as either text/plain or application/json. See #770

0.25.7
------

Expand Down
2 changes: 2 additions & 0 deletions responses/_recorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from responses import RequestsMock
from responses import Response
from responses import _real_send
from responses import _UNSET
from responses.registries import OrderedRegistry


Expand Down Expand Up @@ -153,6 +154,7 @@ def _on_request(
status=requests_response.status_code,
body=requests_response.text,
headers=headers_values,
content_type=requests_response.headers.get("Content-Type", _UNSET),
)
self._registry.add(responses_response)
return requests_response
Expand Down
4 changes: 2 additions & 2 deletions responses/tests/test_recorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def get_data(host, port):
"url": f"http://{host}:{port}/202",
"body": "OK",
"status": 202,
"content_type": "text/plain",
"content_type": "image/tiff",
"auto_calculate_content_length": False,
}
},
Expand Down Expand Up @@ -132,7 +132,7 @@ def prepare_server(self, httpserver):
httpserver.expect_request("/202").respond_with_data(
"OK",
status=202,
content_type="text/plain",
content_type="image/tiff",
)
httpserver.expect_request("/404").respond_with_data(
"404 Not Found",
Expand Down
Loading