Skip to content

Commit

Permalink
Fix header processing
Browse files Browse the repository at this point in the history
  • Loading branch information
munrojm committed Oct 13, 2023
1 parent 879284b commit da8371e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
10 changes: 8 additions & 2 deletions src/maggma/api/resource/read_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,10 @@ def get_by_key(
response = Response(orjson.dumps(response, default=serialization_helper)) # type: ignore

if self.header_processor is not None:
self.header_processor.process_header(response, request)
if self.disable_validation:
self.header_processor.process_header(response, request)

Check warning on line 177 in src/maggma/api/resource/read_resource.py

View check run for this annotation

Codecov / codecov/patch

src/maggma/api/resource/read_resource.py#L176-L177

Added lines #L176 - L177 were not covered by tests
else:
self.header_processor.process_header(temp_response, request)

Check warning on line 179 in src/maggma/api/resource/read_resource.py

View check run for this annotation

Codecov / codecov/patch

src/maggma/api/resource/read_resource.py#L179

Added line #L179 was not covered by tests

return response

Expand Down Expand Up @@ -269,7 +272,10 @@ def search(**queries: Dict[str, STORE_PARAMS]) -> Union[Dict, Response]:
response = Response(orjson.dumps(response, default=serialization_helper)) # type: ignore

if self.header_processor is not None:
self.header_processor.process_header(response, request)
if self.disable_validation:
self.header_processor.process_header(response, request)

Check warning on line 276 in src/maggma/api/resource/read_resource.py

View check run for this annotation

Codecov / codecov/patch

src/maggma/api/resource/read_resource.py#L275-L276

Added lines #L275 - L276 were not covered by tests
else:
self.header_processor.process_header(temp_response, request)

Check warning on line 278 in src/maggma/api/resource/read_resource.py

View check run for this annotation

Codecov / codecov/patch

src/maggma/api/resource/read_resource.py#L278

Added line #L278 was not covered by tests

return response

Expand Down
5 changes: 4 additions & 1 deletion src/maggma/api/resource/s3_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,10 @@ def get_by_key(
response = Response(orjson.dumps(response, default=serialization_helper)) # type: ignore

if self.header_processor is not None:
self.header_processor.process_header(response, request)
if self.disable_validation:
self.header_processor.process_header(response, request)

Check warning on line 127 in src/maggma/api/resource/s3_url.py

View check run for this annotation

Codecov / codecov/patch

src/maggma/api/resource/s3_url.py#L126-L127

Added lines #L126 - L127 were not covered by tests
else:
self.header_processor.process_header(temp_response, request)

Check warning on line 129 in src/maggma/api/resource/s3_url.py

View check run for this annotation

Codecov / codecov/patch

src/maggma/api/resource/s3_url.py#L129

Added line #L129 was not covered by tests

return response

Expand Down

0 comments on commit da8371e

Please sign in to comment.