Skip to content

Commit

Permalink
Changed IRIS blob downloads to include responses as well as blob so 2…
Browse files Browse the repository at this point in the history
…04 (No Content) responses can be captured.
  • Loading branch information
stuartwoodman committed Aug 28, 2024
1 parent b9e6b97 commit ddcece2
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@

import { throwError as observableThrowError, Observable } from 'rxjs';
import { Bbox } from '../../model/data/bbox.model';
import { LayerModel } from '../../model/data/layer.model';
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
import { Injectable, Inject } from '@angular/core';
import { min } from 'rxjs/operators';

/**
* Service to download IRIS data
Expand Down Expand Up @@ -51,9 +49,9 @@ export class DownloadIrisService {
httpParams = httpParams.append('serviceUrls', url);
return this.http.post(this.env.portalBaseUrl + 'downloadDataAsZip.do', httpParams, {
headers: new HttpHeaders().set('Content-Type', 'application/x-www-form-urlencoded'),
responseType: 'blob'
responseType: 'blob',
observe: 'response'
});

} catch (e) {
console.error("Download error:", e);
return observableThrowError(e);
Expand Down Expand Up @@ -103,9 +101,9 @@ export class DownloadIrisService {
return this.http.post(this.env.portalBaseUrl + 'downloadDataAsZip.do', httpParams,
{
headers: new HttpHeaders().set('Content-Type', 'application/x-www-form-urlencoded'),
responseType: 'blob'
responseType: 'blob',
observe: 'response'
});

} catch (e) {
console.error("Download error:", e);
return observableThrowError(e);
Expand Down

0 comments on commit ddcece2

Please sign in to comment.