nasa / nasa/api-docs

The APOD API no longer appears to provide a CORS-friendly way of loading the image itself

Open
#160 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
SCSS
Stars
555
Forks
140
Avg merge
2h 30m
Merged PRs (30d)
3

Description

Previously, based on older issues, there was a suffix path /direct that could appended to the APOD API which would return the image itself, but with CORS allow-origin headers present. It seems to be the below issue referenced by @amygoodchild in a comment back in January.

I have searched but am unable to find an alternative endpoint in any documentation which provides that ability. Was this feature removed? Could it be enabled again? Or perhaps the APOD webserver where the images are hosted could be updated to add CORS headers when serving image file types from within the paths used for serving APOD images?

Mozilla provides details on the process here:
https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image

The original referenced post:

I'm having the same issue. The direct URL is broken and the other one doesn't allow me to use the image url in my code due to a CORS error. Any chance of getting this looked again? Thanks so much!

Originally posted by @amygoodchild in https://github.com/nasa/api-docs/issues/37#issuecomment-759621330

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the APOD API behavior around the documented or previously used /direct suffix and compare it with the APOD image-hosting paths. Use the linked Mozilla CORS guidance to identify the required response behavior; done means a documented, working CORS-friendly way to load APOD images, with the endpoint or hosting change confirmed.

Written by the indexing model from the issue text.

Assessment

Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.