Skip to content

Commit 0aa3d9a

Browse files
authored
fix: add fallback value
1 parent c0f3356 commit 0aa3d9a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const stringReplace = (
1515
const opts = { ...defaultOptions, ...options };
1616
return (_req: Request, res: Response, next: NextFunction) => {
1717
hijackResponse(res, function(err, res) {
18-
const contentType = res.get('content-type');
18+
const contentType = res.get('content-type') || '';
1919
if (opts.contentTypeFilterRegexp.test(contentType)) {
2020
if (err) {
2121
res.unhijack(); // Make the original res object work again

0 commit comments

Comments
 (0)