Custom headers not working
See original GitHub issueI’m trying to get custom headers to work. The example in the documentation doesn’t seem to work. And returns a not found on the method.
this.imageLoaderConfig.setHttpRequestOptions({
headers: {
Authorization: 'Basic dGVzdHVzZXJuYW1lOnRlc3RwYXNzd29yZA=='
}
});
In the code I’m seeing setHttpHeaders is available and that expecting an HttpHeader object.
Tried the example below but not seeing a header.
import { HttpHeaders } from '@angular/common/http';
let headers = new HttpHeaders();
headers.append('Authorization', 'Bearer blablah-blah');
imageLoaderConfig.setHttpHeaders(headers);
imageLoaderConfig.enableDebugMode();
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:8
Top Results From Across the Web
Custom headers not applied · Issue #1317 - GitHub
Manually set custom headers in aws console: security related headers (e.g., X-Frame-Options) are set, but cache-control is not set. cache- ...
Read more >Unable to define custom headers using HttpHeaders on ...
Try checking for any HttpInterceptors that are running on requests. Its possible your headers are being overwritten.
Read more >Custom headers - AWS Amplify Hosting
Custom HTTP headers enable you to specify headers for every HTTP response. Response headers can be used for debugging, security, and informational purposes....
Read more >Access-Control-Allow-Headers - HTTP - MDN Web Docs
It indicates that a custom header named X-Custom-Header is supported by CORS requests to the server (in addition to the CORS-safelisted ...
Read more >Custom headers in netlify.toml not working - Support
Hi, I'm having trouble getting custom headers working, I'm setting them in the netlify.toml file, but no matter what I try they don't...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, that works!
Thank you.
constructor of app.component.ts:
and in the template of the component / page:
then the request header to http://localhost:8080/Application_www/images/web/boxthumb/2039 looks like: