Skip to content

Commit

Permalink
Merge pull request #29 from SkywardApps/ISSUE-28_500_error_when_title…
Browse files Browse the repository at this point in the history
…_includes_unicode_characters

Remove errant space character that was preventing the stripping of un…
  • Loading branch information
ematuschek committed Oct 23, 2023
2 parents 6f1feaa + 52506ba commit 132aab0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/PdfController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export class PdfController
}
else {
// Set the filename to be the title, getting rid of invalid characters
const safeFileName = factory.finalizeString(postBody.title ?? 'document').replace(/[^A-Za-z0-9_.-] /g, '_');
const safeFileName = factory.finalizeString(postBody.title ?? 'document').replace(/[^A-Za-z0-9_.-]/g, '_');
// set Content-type and send data
this.res.setHeader('Content-type', 'application/pdf');
this.res.setHeader('Content-disposition', `attachment; filename="${safeFileName}.pdf"`);
Expand Down

0 comments on commit 132aab0

Please sign in to comment.