vliz-be-opsci / py-sema

Overall parent of all packages involving semantic manipulation of RDF data.
MIT License
0 stars 0 forks source link

Enhance HTTP Header Parsing in Tests with cgi.parse_header() #65

Open cedricdcc opened 1 month ago

cedricdcc commented 1 month ago

Currently, our tests rely on a custom implementation for parsing HTTP headers. This approach, while functional, may lead to unintended (though unlikely) stray matches due to the manual parsing logic. To improve the accuracy and reliability of our tests, we should utilize the cgi.parse_header() function from Python's standard library, which is designed for proper parsing of HTTP headers.

marc-portier commented 1 month ago

one clear case is at https://github.com/vliz-be-opsci/py-sema/blob/46f24a2b5853afe88389eb9f8da1f84635dd8a7d/sema/discovery/url_to_graph.py#L99

additionally, a search for 'Content-Type' references might indicate other locations to fix