Join the AMA (Ask Me Anything) with the Firefox leadership team to celebrate Firefox 20th anniversary and discuss Firefox’s future on Mozilla Connect. Mark your calendar on Thursday, November 14, 18:00 - 20:00 UTC!

当サイトはユーザー体験を改善するためのメンテナンスを実施中に機能が制限される予定です。記事を読んでもあなたの問題が解決せず質問をしたい場合は、Twitter の @FirefoxSupport、Reddit の /r/firefox で、サポートコミュニティが皆さんを助けようと待機しています。

Mozilla サポートの検索

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

詳しく学ぶ

このスレッドはアーカイブに保管されました。 必要であれば新たに質問してください。

Downloading .wav file in Firefox(in others working) using Angular Observable throwing "Http failure response: 0 Unknown Error failed" error

  • 2 件の返信
  • 1 人がこの問題に困っています
  • 1 回表示
  • 最後の返信者: akashmittal

more options

Sample Code Snippet:

"downloadFile(payLoad: any): Observable	<HttpResponse<any>> {
   return this.http.post(this.fileDownloadUrl, payLoad,
     { headers: { 'Content-Type': 'application/json' }, observe: 'response', responseType: 'blob' });
 } "

This snippet is working for all other browsers except Firefox. I have tested it on Version 68.0.2 (64-bit), Version 69.0 (64-bit).

Can anyone help on the fix or any alternative way to download wav file in Angular 7?

Sample Code Snippet: "downloadFile(payLoad: any): Observable &lt;HttpResponse&lt;any&gt;&gt; { return this.http.post(this.fileDownloadUrl, payLoad, { headers: { 'Content-Type': 'application/json' }, observe: 'response', responseType: 'blob' }); } " This snippet is working for all other browsers except Firefox. I have tested it on Version 68.0.2 (64-bit), Version 69.0 (64-bit). Can anyone help on the fix or any alternative way to download wav file in Angular 7?

この投稿は akashmittal により に変更されました

すべての返信 (2)

more options

Are the CORS headers set properly? Could you show your header list?

more options

Hi Mesko,

The application don't have any 3rd party dependency thus we have blocked CORS here due to security reason. All resources that application needs are there on single server on which it is deployed. I am sharing the headers for your reference:

Request Header: Host: ******************* User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0 Accept: application/json, text/plain, */* Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate, br Content-Type: application/json X-CSRF-TOKEN: 66f60688-b6ae-44ff-96f1-0ee3cf9c595b Content-Length: 74 DNT: 1 Connection: keep-alive Referer: https://******************************** Cookie: JSESSIONID=ADC4844F95A6711A5AE383D95CD3A424; X-CSRF-TOKEN=66f60688-b6ae-44ff-96f1-0ee3cf9c595b Pragma: no-cache Cache-Control: no-cache

Response Header: HTTP/1.1 200 X-CSRF-HEADER: X-CSRF-TOKEN X-CSRF-PARAM: _csrf X-CSRF-TOKEN: 66f60688-b6ae-44ff-96f1-0ee3cf9c595b Set-Cookie: X-CSRF-TOKEN=66f60688-b6ae-44ff-96f1-0ee3cf9c595b; Path=/; Secure Content-disposition: attachment;filename=temp.wav X-Content-Type-Options: nosniff X-XSS-Protection: 1; mode=block Cache-Control: no-cache, no-store, max-age=0, must-revalidate Pragma: no-cache Expires: 0 Strict-Transport-Security: max-age=31536000 ; includeSubDomains X-Frame-Options: SAMEORIGIN Content-Security-Policy: default-src 'self' data: 'unsafe-eval' 'unsafe-inline'; Transfer-Encoding: chunked Date: Mon, 09 Sep 2019 06:25:15 GMT

Hope you can help us on where we are going wrong.

Thanks

この投稿は akashmittal により に変更されました