Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- Fixed an issue where opening an unconfigured project from a git repository sub-directory (such as a monorepo package) skipped project setup. Additionally, the component testing setup wizard now reliably displays the auto-detected framework and bundler. Fixes [#27410](https://github.com/cypress-io/cypress/issues/27410) and [#29544](https://github.com/cypress-io/cypress/issues/29544). Fixed in [#34129](https://github.com/cypress-io/cypress/pull/34129) and [#34212](https://github.com/cypress-io/cypress/pull/34212).
- Fixed an issue where interacting with an element inside a horizontally-scrollable container could scroll the element to the container's right edge, placing it underneath a right-floating `position: sticky` or `position: fixed` element and causing the action to fail or land on the wrong element. Elements are now scrolled to their top, leftmost point as documented. Fixes [#33884](https://github.com/cypress-io/cypress/issues/33884). Fixed in [#34108](https://github.com/cypress-io/cypress/pull/34108).
- Fixed a regression in [15.17.0](#15-17-0) where `cypress run --spec` printed a spurious `The following --spec pattern did not match any spec files and will be ignored` warning for patterns that actually did match spec files, such as patterns using regex-style alternation groups (for example `cypress/e2e/(a|b)/*.js`). Fixes [#34160](https://github.com/cypress-io/cypress/issues/34160).
- Fixed an issue where cookie headers forwarded through the proxy for WebDriver BiDi browsers could be normalized with inconsistent double spacing (for example `foo=bar; bar=baz`) when the incoming header mixed spaced and unspaced delimiters. Delimiters are now normalized to a single `; `. Fixed in [#34207](https://github.com/cypress-io/cypress/pull/34207).

**Dependency Updates:**

Expand Down
2 changes: 1 addition & 1 deletion packages/proxy/lib/http/request-middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ const FormatCookiesIfApplicable: RequestMiddleware = function () {
const bidiStyleCookie = /;\S/gm

if (cookies.match(bidiStyleCookie)) {
this.req.headers.cookie = cookies.replaceAll(';', '; ')
this.req.headers.cookie = cookies.replace(/;\s*/g, '; ')
}
}

Expand Down
20 changes: 20 additions & 0 deletions packages/proxy/test/unit/http/request-middleware.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,26 @@ describe('http/request-middleware', () => {
expect(ctx.req.headers['cookie']).toEqual('foo=bar; bar=baz; qux=quux')
expect(ctx.req.headers!['x-cypress-is-webdriver-bidi']).toBeUndefined()
})

it('does not double-space cookies that are delimited inconsistently', async () => {
const ctx = {
req: {
headers: {
'x-cypress-is-webdriver-bidi': true,
cookie: 'foo=bar; bar=baz;qux=quux',
},
},
res: {
on: (event, listener) => {},
off: (event, listener) => {},
},
}

await testMiddleware([FormatCookiesIfApplicable], ctx)

expect(ctx.req.headers['cookie']).toEqual('foo=bar; bar=baz; qux=quux')
expect(ctx.req.headers!['x-cypress-is-webdriver-bidi']).toBeUndefined()
})
})
})

Expand Down