Skip to content
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

Added crossOrigin option #1393

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jpeirson
Copy link

Pull request type

Check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

NOTE: Before to create a PR, read our contributing guide

NOTE: Try to limit your pull request to one type, submit multiple pull requests if needed.

What is the current behavior?

Issue Number: N/A

NOTE: Describe the current behavior that you are modifying, or link to a relevant issue.

When using the node.image program, the crossOrigin attribute is hardcoded to "" (anonymous fetch). If the img resource requires credentials, then image requests will always fail with HTTP 401, and the requested images will never be rendered on nodes.

What is the new behavior?

NOTE: Describe the behavior or changes that are being added by this PR.

Builds on PR #1147, where rather than hardcoding the crossOrigin attribute, the caller can provide a param value. Param value must be a valid HTML img crossOrigin value (TS check only). No breaking change in behavior - new params arg is optional. Also, FWIW, I've added a null param value which allows a user to override the behavior from PR #1147 and not specify a crossOrigin attribute.

This change specifically supports the (my) use case where node image URL resources are protected by a layer of authentication.

Other information

NOTE: Any other information that is important to this PR such as screenshots of how the component looks before and after the change.

https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/crossOrigin

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.

None yet

1 participant