Skip to content

Commit d7ea250

Browse files
Update multipart boundary error to match Vuforia (#3044)
* Update multipart boundary error message to match Vuforia change Vuforia dropped the "RESTEASY007550: " prefix from the error message for missing multipart boundaries. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Update */* boundary error response to match Vuforia (400, text/plain) Vuforia now returns 400 with text/plain;charset=utf-8 instead of 500 with application/json for the no-boundary multipart error. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 3f12eab commit d7ea250

2 files changed

Lines changed: 9 additions & 11 deletions

File tree

src/mock_vws/_query_validators/exceptions.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -604,18 +604,16 @@ def __init__(self) -> None:
604604
raised.
605605
"""
606606
super().__init__()
607-
self.status_code = HTTPStatus.INTERNAL_SERVER_ERROR
608-
self.response_text = (
609-
"RESTEASY007550: Unable to get boundary for multipart"
610-
)
607+
self.status_code = HTTPStatus.BAD_REQUEST
608+
self.response_text = "Unable to get boundary for multipart"
611609

612610
date = email.utils.formatdate(
613611
timeval=None,
614612
localtime=False,
615613
usegmt=True,
616614
)
617615
self.headers = {
618-
"Content-Type": "application/json",
616+
"Content-Type": "text/plain;charset=utf-8",
619617
"Connection": "keep-alive",
620618
"Server": "nginx",
621619
"Date": date,

tests/mock_vws/test_query.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,10 @@ class TestContentType:
179179
),
180180
(
181181
"*/*",
182-
HTTPStatus.INTERNAL_SERVER_ERROR,
183-
"application/json",
182+
HTTPStatus.BAD_REQUEST,
183+
"text/plain;charset=utf-8",
184184
None,
185-
"RESTEASY007550: Unable to get boundary for multipart",
185+
"Unable to get boundary for multipart",
186186
),
187187
(
188188
"text/*",
@@ -404,12 +404,12 @@ def test_no_boundary(
404404
tell_position=requests_response.raw.tell(),
405405
content=requests_response.content,
406406
)
407-
expected_text = "RESTEASY007550: Unable to get boundary for multipart"
407+
expected_text = "Unable to get boundary for multipart"
408408
assert requests_response.text == expected_text
409409
assert_vwq_failure(
410410
response=vws_response,
411-
status_code=HTTPStatus.INTERNAL_SERVER_ERROR,
412-
content_type="application/json",
411+
status_code=HTTPStatus.BAD_REQUEST,
412+
content_type="text/plain;charset=utf-8",
413413
cache_control=None,
414414
www_authenticate=None,
415415
connection="keep-alive",

0 commit comments

Comments
 (0)