cypress icon indicating copy to clipboard operation
cypress copied to clipboard

Content-Type and other headers missing in gRPC requests in Cypress with Connect-ES

Open robertwenquan opened this issue 1 year ago • 1 comments

Current behavior

In Cypress E2E test, a few HTTP headers are not set. Specifically, Content-Type header is not set along with other headers with running with cypress that lead to 415 Content not supported error returned from the API gateway. The request doesn't reach the API server bacause of this.

Desired behavior

Content-Type and other headers are set just like it behaves in a normal Chrome browser.

Test code to reproduce

describe("LoginForm component test", () => {
    it("normal login", () => {
        cy.visit("/login");
        cy.get("[data-cy='input-email']").type("[[email protected]](mailto:[email protected])");
        cy.get("[data-cy='input-password']").type("password.123{enter}");
    });
});

Cypress Version

13.6.3

Node version

v20.10.0

Operating System

macOS 14.2.1 (23C71)

Debug Logs

No response

Other

Browser console

img_v3_027m_e33aba24-cad2-41d1-bcbf-a10a8c45136g

Running console

img_v3_027m_2bf823e2-463a-4fac-a1ac-324cfce4f20g

Business Logic code

img_v3_027m_f9b34815-86df-4bb6-b304-c3341a424b7g

Expected Good Behavior on a regular browser

img_v3_027m_95ac6e5e-076d-4177-bb9d-7e026200a3cg

The behavior with cypress:open

missing headers with cypress

img_v3_027m_01f634e3-4aa7-44a5-afdd-09befeb395dg

robertwenquan avatar Feb 02 '24 06:02 robertwenquan

Does it worked in previous cypress version ???

senpl avatar Feb 15 '24 12:02 senpl

Does it worked in previous cypress version ???

seems not related to previous version.

this was cleared by either:

  1. changed the ConnectTransport to WebTransport (grpc-web)
  2. removed experimentalFetchPolyfill: true while keeping the ConnectTransport

In the end we changed to WebTransport and disabled the experimentalFetchPolyfill as well.

robertwenquan avatar Feb 21 '24 16:02 robertwenquan

Hey @jennifer-shehane any opportunity to get some attention from Cypress? I am trying my best to figure out the situation but I am not sure what else to try. The changes suggested by @robertwenquan didn't work me

yordis avatar Jun 11 '24 00:06 yordis