Skip to content

Fix fetch_sdss_spectrum for HTTPS SDSS downloads - #285

Open
Jiangxuejian wants to merge 1 commit into
astroML:mainfrom
Jiangxuejian:fix-issue-284-sdss-spectrum-download
Open

Fix fetch_sdss_spectrum for HTTPS SDSS downloads#285
Jiangxuejian wants to merge 1 commit into
astroML:mainfrom
Jiangxuejian:fix-issue-284-sdss-spectrum-download

Conversation

@Jiangxuejian

Copy link
Copy Markdown

Fixes #284.

fetch_sdss_spectrum currently fails against the SDSS endpoint with HTTP Error 308: Permanent Redirect because the downloader still uses http. Switching the URL to https also exposed a second issue in url_content_length(), which assumes a specific header casing for Content-Length.

This patch:

  • updates the SDSS spectrum URL to use https
  • makes url_content_length() read the header in a case-insensitive-safe way
  • updates SDSSfits so https://... sources are treated as remote FITS URLs
  • adds regression tests for all three behaviors

Testing:

  • added regression tests in astroML/datasets/tests/test_datasets.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fetch_sdss_spectrum HTTP Error 308: Permanent Redirect

1 participant