Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(x3): content type missing charset #311

Merged
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
2 changes: 1 addition & 1 deletion apps/billing/services/processor_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def send_transaction_to_processor(self) -> dict:
response = requests.post(
url=self.__processor_url,
data=self.data,
headers={"Content-type": "application/xml; charset=utf-8", "SOAPAction": "''"},
headers={"Content-type": "text/xml; charset=UTF-8", "SOAPAction": "''"},
auth=(
self.__user_processor_auth,
self.__user_processor_password,
Expand Down
2 changes: 1 addition & 1 deletion apps/billing/tests/test_sagex3_processor_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def test_send_transaction_to_processor_header_content_type(self, mock_data, mock
SageX3Processor(None).send_transaction_to_processor()
_, kwargs = mock_post.call_args
called_headers = kwargs["headers"]
self.assertEqual("application/xml; charset=utf-8", called_headers["Content-type"])
self.assertEqual("text/xml; charset=UTF-8", called_headers["Content-type"])

@mock.patch("requests.post", return_value=MockResponse(data="", status_code=200))
@mock.patch("apps.billing.services.processor_service.SageX3Processor.data", side_effect=lambda: {"some": "thing"})
Expand Down
Loading