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

Fixing issue where the ajaxHeaders are not being set for image requests #1968

Merged
merged 1 commit into from
Apr 19, 2021

Conversation

maxshuty
Copy link
Contributor

This PR fixes an issue where image requests with custom ajaxHeaders set do not actually use those ajaxHeaders. For example if I have this code below where I am dynamically adding images and each image has it's own ajaxHeaders set:

    urls.forEach((url, index) => {
        viewer.addTiledImage({
            tileSource: url,
            loadTilesWithAjax: true,
            width: 10,
            ajaxHeaders: {
                Authorization: tokens[index],
            },
        });
    });

The requests to not actually use the ajaxHeaders for these images until actual tile requests are made.

This PR fixes this issue.

cc: @iangilman as we chatted on Gitter about this.

Copy link
Member

@iangilman iangilman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beautiful, thank you!

@iangilman iangilman merged commit 16a255a into openseadragon:master Apr 19, 2021
iangilman added a commit that referenced this pull request Apr 19, 2021
msalsbery pushed a commit that referenced this pull request May 2, 2021
* master: (27 commits)
  Changelog for #1968
  Fixing issue where the ajaxHeaders were not being set for image requests
  Changelog for #1865
  Changelog for #1937
  Changelog for #1903
  refactor: moved methods that belongs together closer
  Make setFlip() update the navigator
  refactor: use pixelDensityRatio in getPixelRatio()
  fix: removes resize event on destroy
  docs: fixed typo and corrected the comment
  fix: made updatePixelDensityRatio private
  Improve the flipping example
  Tidy up the tile/image flip check
  Force reload tiles when the tile's flip doesn't match the image
  Add a basic setFlip method to TiledImage
  Add flipping example
  Correctly set the rightmost tile property when flipped
  Render the flipped columns in reverse order
  Store the flipped state in each tile and render it as such
  Introduce getTileBounds method for tiledImage
  ...
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.

2 participants