ember-fastboot / ember-fastboot/ember-cli-fastboot

FastBootAppServer duplicates response headers

Open
#884 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
850
Forks
161
Avg merge
17h 45m
Merged PRs (30d)
19

Description

FastBootAppServer duplicates response headers which were set by middleware registered in beforeMiddleware hook.

![issue-screenshot](https://user-images.githubusercontent.com/60934135/149377587-66fb201e-bed6-4853-9df7-f505ab3050b6.png)

I've found that it happens during fastboot-express-middleware execution, here:
https://github.com/ember-fastboot/ember-cli-fastboot/blob/master/packages/fastboot-express-middleware/src/index.js
lines: 44-46

From my perspective, the problem is that code doesn't check already existing response headers before adding new headers from `result.headers`.

Here, you can find a prepared by me demo of the issue:
https://github.com/yevhenii-pinkal/fastboot-duplicates-headers-issue/tree/master

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.