Skip to content

Commit

Permalink
[ts] Guard against null undefined content-disposition header in downl…
Browse files Browse the repository at this point in the history
…oadExpungementPacket
  • Loading branch information
monocle committed Dec 21, 2022
1 parent b7fa20f commit 482877a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/frontend/src/redux/search/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function buildAndSendDownloadPdfRequest(dispatch: any): any {
responseType: "blob",
})
.then((response: AxiosResponse) => {
const filename = response.headers["content-disposition"]
const filename = (response.headers["content-disposition"] ?? "")
.split("filename=")[1]
.split(" ")[0];
fileDownload(response.data, filename);
Expand Down Expand Up @@ -301,7 +301,7 @@ export function downloadExpungementPacket(
responseType: "blob",
})
.then((response: AxiosResponse) => {
const filename = response.headers["content-disposition"]
const filename = (response.headers["content-disposition"] ?? "")
.split("filename=")[1]
.split(" ")[0];
fileDownload(response.data, filename);
Expand Down

0 comments on commit 482877a

Please sign in to comment.