mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-11 04:22:13 +00:00
[routing-utils] Ensure headers with only has items are replaced correctly (#6686)
This ensures we replace header values correctly when no named segments are used and only has items are used. ### Related Issues Fixes: https://vercel.slack.com/archives/CHTTGQYQ4/p1631023974185700 ### 📋 Checklist <!-- Please keep your PR as a Draft until the checklist is complete --> #### Tests - [x] The code changed/added as part of this PR has been covered with tests - [x] All tests pass locally with `yarn test-unit` #### Code Review - [ ] This PR has a concise title and thorough description useful to a reviewer - [ ] Issue from task tracker has a link to this PR
This commit is contained in:
@@ -112,7 +112,7 @@ export function convertHeaders(headers: Header[]): Route[] {
|
||||
});
|
||||
|
||||
h.headers.forEach(({ key, value }) => {
|
||||
if (namedSegments.length > 0) {
|
||||
if (namedSegments.length > 0 || hasSegments.length > 0) {
|
||||
if (key.includes(':')) {
|
||||
key = safelyCompile(key, indexes);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user