-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Content-Type and other HTTP headers missing with gRPC requests when launching in Cypress E2E Test #1010
Comments
Thank you for opening the issue on both repos. The code for headers is pretty much identical between the two transports except for the contents of the headers. I don't see any One odd thing from the cypress screenshot is that it is receiving the headers and is trying to stringify the function properties of the |
I switched the client, and still failing, --- a/packages/zitadel-node/src/index.ts
+++ b/packages/zitadel-node/src/index.ts
@@ -1,8 +1,9 @@
import { NewAuthorizationBearerInterceptor } from "@zitadel/client2";
-import {
- createGrpcWebTransport,
- GrpcTransportOptions,
-} from "@connectrpc/connect-node";
+// import {
+// createGrpcWebTransport,
+// GrpcTransportOptions,
+// } from "@connectrpc/connect-node";
+import { createGrpcWebTransport, GrpcWebTransportOptions } from "@connectrpc/connect-web";
import { importPKCS8, SignJWT } from "jose";
/**
@@ -12,7 +13,7 @@ import { importPKCS8, SignJWT } from "jose";
*/
export function createServerTransport(
token: string,
- opts: GrpcTransportOptions,
+ opts: GrpcWebTransportOptions,
) {
return createGrpcWebTransport({
...opts,
|
@yordis I don't think the issue related, the error trace you pasted is using undici which is a node package, it is not related to web. If you are using the clients on node, you should use the transports from the |
@srikrsna-buf As you could notice, it used to be the |
@yordis, same issue when using playwright. I'm wondering if you managed to solve it and mind sharing please. |
Our issue was due to the server not being able to handle the header; |
Describe the bug
As clearly as you can, please tell us what the bug is.
In the Cypress E2E (end to end) test, the
Content-Type
header is missing(not attached) to the request when launched with the Cypress when the client is making the transport astransport = createConnectTransport
However, in the normal browser case, everything works fine. The
Content-Type
HTTP header could be observed when it's launched in a regular Chrome browser.The workaround is to switch the transport to
transport = createGrpcWebTransport
, the problem is gone.To Reproduce
If you encountered an error message, please copy and paste it verbatim.
If the bug is specific to an RPC or payload, please provide a reduced
example.
The business logic part of the code is simplied to this
This is what's expected, when launched from a regular browser
This is what happened within Cypress run. With the same request, but missing a few HTTP headers. Specifically, the
Content-Type
header is missing when it's launched in Cypress.Environment (please complete the following information):
0.1.0
) 1.3.00.1.0
) 1.1.2"[email protected]
) [email protected]18.0.0
) v20.10.0Google Chrome 103.0.5060.134
)If your problem is specific to bundling, please also provide the following information:
[email protected]
)[email protected]
)Additional context
Add any other context about the problem here.
An issue cypress-io/cypress#28849 was reported on the cypress side as well.
The text was updated successfully, but these errors were encountered: