09-13-2022 06:53 AM
Hi, i have problem while getting content-disposition from headers using angular, while fetching a file from cisco api it was not allowing to fetch the content-disposition, so if anyone has idea on this situation please let me know how to resolve it(Java Script example is also fine).
Thank you
09-13-2022 07:06 AM - edited 09-13-2022 07:07 AM
@Ananth Kakarlapudi what API are you exactly using? And how does your full request look like?
09-20-2022 12:15 AM
Hi @Janos Benyovszki i have shared you the error which i am getting and API which i am using, please let me know if you require any additional information thank you
09-14-2022 12:46 AM
Hi,
When using this code i am getting CORS error as attached
this.http.get<any>(url, {
headers: new HttpHeaders({
'Content-Type': 'application/json',
Authorization: 'Bearer ' + data.access_token,
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods' : 'GET, POST, OPTIONS',
'Access-Control-Allow-Headers' : 'OX-API-KEY, Origin, X-Requested-With, Content-Type, Accept, Access-Control-Request-Method, Content-Disposition, Authorization, authorization'
}),
responseType: 'blob' as 'json',
observe: 'response' as 'body'
} as any).subscribe((data1: HttpResponse<any>) => {
data1.headers.get('authorization');
const content = data1.headers.getAll('Content-Disposition');
09-20-2022 06:04 AM - edited 09-20-2022 06:04 AM
What headers do you see if you log the header keys, something like this?
09-20-2022 06:07 AM
Hi @Jeff Marshall i am getting cache-control, content-type when logging headers but not able to get content-disposition
09-20-2022 12:18 PM
We've opened a ticket with engineering to have them add the 'content-disposition' header to the allowed CORS headers so the browser will allow angular to see it. Not sure when that may be completed though.
09-20-2022 10:19 PM
Thanks @Jeff Marshall for the support
09-20-2022 06:23 AM
Based on what I'm finding it seems that angular has to be explicitly told what headers it's allowed to see by the server side using a Access-Control-Expose-Headers header.
Found several stackoverflow posts on it but this one is:
https://stackoverflow.com/questions/45480738/with-angulars-new-httpclient-how-can-i-get-all-headers-when-subscribing-to-the/45482346#45482346
In a quick test I did it seems angular can only see 'cache-control', 'content-type', and 'trackingid' headers from the /contents endpoint.
Can you send your details to devsupport@webex.com so a support ticket is generated and this can be investigated more thoroughly?
11-16-2022 09:00 AM
@Ananth Kakarlapudi, engineering has pushed out an update so now web apps, such as angular apps, should be able to see the content-disposition header.
11-16-2022 09:26 PM
Thank you @Jeff Marshall for the help yes its working now
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide