From 9374dee749fd7388948212ac554848f6b4872954 Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Tue, 10 Mar 2026 09:48:32 +0000 Subject: [PATCH 1/2] 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 --- src/mock_vws/_query_validators/exceptions.py | 4 +--- tests/mock_vws/test_query.py | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/mock_vws/_query_validators/exceptions.py b/src/mock_vws/_query_validators/exceptions.py index 6417595f4..bdc9044e9 100644 --- a/src/mock_vws/_query_validators/exceptions.py +++ b/src/mock_vws/_query_validators/exceptions.py @@ -605,9 +605,7 @@ def __init__(self) -> None: """ super().__init__() self.status_code = HTTPStatus.INTERNAL_SERVER_ERROR - self.response_text = ( - "RESTEASY007550: Unable to get boundary for multipart" - ) + self.response_text = "Unable to get boundary for multipart" date = email.utils.formatdate( timeval=None, diff --git a/tests/mock_vws/test_query.py b/tests/mock_vws/test_query.py index 0a1102643..16c190187 100644 --- a/tests/mock_vws/test_query.py +++ b/tests/mock_vws/test_query.py @@ -182,7 +182,7 @@ class TestContentType: HTTPStatus.INTERNAL_SERVER_ERROR, "application/json", None, - "RESTEASY007550: Unable to get boundary for multipart", + "Unable to get boundary for multipart", ), ( "text/*", @@ -404,7 +404,7 @@ def test_no_boundary( tell_position=requests_response.raw.tell(), content=requests_response.content, ) - expected_text = "RESTEASY007550: Unable to get boundary for multipart" + expected_text = "Unable to get boundary for multipart" assert requests_response.text == expected_text assert_vwq_failure( response=vws_response, From b6295103507f0f3c6b1c19f6d578f08522027618 Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Tue, 10 Mar 2026 10:08:12 +0000 Subject: [PATCH 2/2] 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 --- src/mock_vws/_query_validators/exceptions.py | 4 ++-- tests/mock_vws/test_query.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mock_vws/_query_validators/exceptions.py b/src/mock_vws/_query_validators/exceptions.py index bdc9044e9..bb830651b 100644 --- a/src/mock_vws/_query_validators/exceptions.py +++ b/src/mock_vws/_query_validators/exceptions.py @@ -604,7 +604,7 @@ def __init__(self) -> None: raised. """ super().__init__() - self.status_code = HTTPStatus.INTERNAL_SERVER_ERROR + self.status_code = HTTPStatus.BAD_REQUEST self.response_text = "Unable to get boundary for multipart" date = email.utils.formatdate( @@ -613,7 +613,7 @@ def __init__(self) -> None: usegmt=True, ) self.headers = { - "Content-Type": "application/json", + "Content-Type": "text/plain;charset=utf-8", "Connection": "keep-alive", "Server": "nginx", "Date": date, diff --git a/tests/mock_vws/test_query.py b/tests/mock_vws/test_query.py index 16c190187..aa1461abe 100644 --- a/tests/mock_vws/test_query.py +++ b/tests/mock_vws/test_query.py @@ -179,8 +179,8 @@ class TestContentType: ), ( "*/*", - HTTPStatus.INTERNAL_SERVER_ERROR, - "application/json", + HTTPStatus.BAD_REQUEST, + "text/plain;charset=utf-8", None, "Unable to get boundary for multipart", ), @@ -408,8 +408,8 @@ def test_no_boundary( assert requests_response.text == expected_text assert_vwq_failure( response=vws_response, - status_code=HTTPStatus.INTERNAL_SERVER_ERROR, - content_type="application/json", + status_code=HTTPStatus.BAD_REQUEST, + content_type="text/plain;charset=utf-8", cache_control=None, www_authenticate=None, connection="keep-alive",