Skip to content

Commit 40c7a91

Browse files
improves HTTP code semantics
1 parent aaab1a5 commit 40c7a91

File tree

8 files changed

+16
-16
lines changed

8 files changed

+16
-16
lines changed

src/routes/environment.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,12 @@ async def delete_environment(environment_id: str) -> None:
9090
@router.get(
9191
"/{environment_id}/rocketpy",
9292
responses={
93-
203: {
93+
200: {
9494
"description": "Binary file download",
9595
"content": {"application/octet-stream": {}},
9696
}
9797
},
98-
status_code=203,
98+
status_code=200,
9999
response_class=Response,
100100
)
101101
async def get_rocketpy_environment_binary(environment_id: str):
@@ -118,7 +118,7 @@ async def get_rocketpy_environment_binary(environment_id: str):
118118
content=binary,
119119
headers=headers,
120120
media_type="application/octet-stream",
121-
status_code=203,
121+
status_code=200,
122122
)
123123

124124

src/routes/flight.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,12 @@ async def delete_flight(flight_id: str) -> None:
8686
@router.get(
8787
"/{flight_id}/rocketpy",
8888
responses={
89-
203: {
89+
200: {
9090
"description": "Binary file download",
9191
"content": {"application/octet-stream": {}},
9292
}
9393
},
94-
status_code=203,
94+
status_code=200,
9595
response_class=Response,
9696
)
9797
async def get_rocketpy_flight_binary(flight_id: str):
@@ -112,7 +112,7 @@ async def get_rocketpy_flight_binary(flight_id: str):
112112
content=binary,
113113
headers=headers,
114114
media_type="application/octet-stream",
115-
status_code=203,
115+
status_code=200,
116116
)
117117

118118

src/routes/motor.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,12 @@ async def delete_motor(motor_id: str) -> None:
8484
@router.get(
8585
"/{motor_id}/rocketpy",
8686
responses={
87-
203: {
87+
200: {
8888
"description": "Binary file download",
8989
"content": {"application/octet-stream": {}},
9090
}
9191
},
92-
status_code=203,
92+
status_code=200,
9393
response_class=Response,
9494
)
9595
async def get_rocketpy_motor_binary(motor_id: str):
@@ -110,7 +110,7 @@ async def get_rocketpy_motor_binary(motor_id: str):
110110
content=binary,
111111
headers=headers,
112112
media_type="application/octet-stream",
113-
status_code=203,
113+
status_code=200,
114114
)
115115

116116

src/routes/rocket.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,12 @@ async def delete_rocket(rocket_id: str) -> None:
8484
@router.get(
8585
"/{rocket_id}/rocketpy",
8686
responses={
87-
203: {
87+
200: {
8888
"description": "Binary file download",
8989
"content": {"application/octet-stream": {}},
9090
}
9191
},
92-
status_code=203,
92+
status_code=200,
9393
response_class=Response,
9494
)
9595
async def get_rocketpy_rocket_binary(rocket_id: str):
@@ -110,7 +110,7 @@ async def get_rocketpy_rocket_binary(rocket_id: str):
110110
content=binary,
111111
headers=headers,
112112
media_type="application/octet-stream",
113-
status_code=203,
113+
status_code=200,
114114
)
115115

116116

tests/unit/test_routes/test_environments_route.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ def test_read_rocketpy_environment_binary(mock_controller_instance):
229229
mock_response = AsyncMock(return_value=b'rocketpy')
230230
mock_controller_instance.get_rocketpy_environment_binary = mock_response
231231
response = client.get('/environments/123/rocketpy')
232-
assert response.status_code == 203
232+
assert response.status_code == 200
233233
assert response.content == b'rocketpy'
234234
assert response.headers['content-type'] == 'application/octet-stream'
235235
mock_controller_instance.get_rocketpy_environment_binary.assert_called_once_with(

tests/unit/test_routes/test_flights_route.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ def test_read_rocketpy_flight_binary(mock_controller_instance):
339339
return_value=b'rocketpy'
340340
)
341341
response = client.get('/flights/123/rocketpy')
342-
assert response.status_code == 203
342+
assert response.status_code == 200
343343
assert response.content == b'rocketpy'
344344
assert response.headers['content-type'] == 'application/octet-stream'
345345
mock_controller_instance.get_rocketpy_flight_binary.assert_called_once_with(

tests/unit/test_routes/test_motors_route.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ def test_read_rocketpy_motor_binary(mock_controller_instance):
385385
mock_response = AsyncMock(return_value=b'rocketpy')
386386
mock_controller_instance.get_rocketpy_motor_binary = mock_response
387387
response = client.get('/motors/123/rocketpy')
388-
assert response.status_code == 203
388+
assert response.status_code == 200
389389
assert response.content == b'rocketpy'
390390
assert response.headers['content-type'] == 'application/octet-stream'
391391
mock_controller_instance.get_rocketpy_motor_binary.assert_called_once_with(

tests/unit/test_routes/test_rockets_route.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ def test_read_rocketpy_rocket_binary(mock_controller_instance):
446446
mock_response = AsyncMock(return_value=b'rocketpy')
447447
mock_controller_instance.get_rocketpy_rocket_binary = mock_response
448448
response = client.get('/rockets/123/rocketpy')
449-
assert response.status_code == 203
449+
assert response.status_code == 200
450450
assert response.content == b'rocketpy'
451451
assert response.headers['content-type'] == 'application/octet-stream'
452452
mock_controller_instance.get_rocketpy_rocket_binary.assert_called_once_with(

0 commit comments

Comments
 (0)