OnlineAccessUrls and OnlineResource (echo-g) #336
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a pull request for issue url_description_uniqueness_check (Granule): #322
Expected outcome:
For OnlineAccessURLs / OnlineAccessURL / URL PyQuARC should flag:
if there is ftp link in urls (Error)
if the url is broken (Error) and
if the http link is not secure (Info)
Code Changes:
Added a new check function for protocol check and secure http link in the url_validator.py and added corresponding check messages and registered new checks in check_messages.json and checks.json respectively.
Finally, added the corresponding rule mappings in rule_mapping.json.
To Reproduce:
Example concept ID: G2488091813-CDDIS --format echo-g
Problem:
While checking the broken link most of the urls returned 200 status code while visiting the url instead of downloading the data. So it was not possible to check the broken link with any granule id. To simulate a broken link scenario, temporarily hardcode a 404 response code in the health_and_status_check function in url_validator.py in line 71.