question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Request headers in config are not sent for tiled images

See original GitHub issue

I noticed that when setting an authorization header via the requestHeaders config that the header does not get sent for tiled images.

https://photo-sphere-viewer.js.org/guide/config.html#requestheaders

I am dynamically setting the request header with a token using a function like this:

function changeRequestToken(token: string) {
  viewer.config.requestHeaders = (url) => {
    console.debug(`requesting asset ${url} with token ${token}`);
    return { Authorization: `Bearer ${token}` };
  };
}

If I use the standard equirectangular adapter, the header is sent as expected: image

If I switch to the equirectangular tiled adapter, the header gets sent for the low resolution preview image: image

But the header fails to be sent for the image tiles: image

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mistic100commented, Sep 23, 2022

Let’s got a runtime warning

EquirectangularTilesAdapter fallbacks to file loader because “requestHeaders” where provided. Consider removing “requestHeaders” if you experience performances issues.

0reactions
github-actions[bot]commented, Nov 16, 2022

This feature/bug fix has been released in version 4.8.0.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Passing authorization header for images src to remote server ...
The idea is that, when you use <img src="http://foo.com/image/1"> there is no way to pass the authorization headers.
Read more >
axios doesn't see request headers that I set #891 - GitHub
The request is sent successfully so I don't write the code where I call axios. The problem is I couldn't set the headers....
Read more >
HTTP Error 431: 3 Ways to Fix Request Header Fields Too ...
The HTTP Error 431: Request Header Fields Too Large response status code indicates that the origin server refuses to fulfill users' requests.
Read more >
HTTP security headers: An easy way to harden your web ...
Modern browsers support a wide array of HTTP headers that can improve web application security to protect against clickjacking, ...
Read more >
Request headers and responses - App Engine - Google Cloud
An incoming HTTP request includes the HTTP headers sent by the client. For security purposes, some headers are sanitized, amended, or removed by ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found