-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update cmr mappings #1102
base: dev
Are you sure you want to change the base?
Update cmr mappings #1102
Conversation
def test_sde_link_generation(self): | ||
data = {"meta": {"concept-id": "C179001887-SEDAC"}} | ||
dataset = CmrDataset(data) | ||
assert "sciencediscoveryengine.nasa.gov" in dataset.sde_link |
Check failure
Code scanning / CodeQL
Incomplete URL substring sanitization High test
sciencediscoveryengine.nasa.gov
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 11 days ago
To fix the problem, we need to parse the URL and check the hostname to ensure it matches the expected value. This can be done using the urlparse
function from the urllib.parse
module. We will extract the hostname from the URL and verify that it matches "sciencediscoveryengine.nasa.gov".
- Parse the URL using
urlparse
. - Extract the hostname from the parsed URL.
- Check if the hostname matches "sciencediscoveryengine.nasa.gov".
-
Copy modified lines R451-R453
@@ -450,3 +450,5 @@ | ||
dataset = CmrDataset(data) | ||
assert "sciencediscoveryengine.nasa.gov" in dataset.sde_link | ||
from urllib.parse import urlparse | ||
parsed_url = urlparse(dataset.sde_link) | ||
assert parsed_url.hostname == "sciencediscoveryengine.nasa.gov" | ||
assert "C179001887-SEDAC" in dataset.sde_link |
No description provided.