Chrome's "Copy as cURL" does not work with gRPC-web #1440
dimo414
started this conversation in
Ecosystem support
Replies: 2 comments 1 reply
-
@dimo414 Wow! Thanks for reporting this "subtle" issue.. 😄 I've filed a chrome bug and hope they might have an idea 😃 Thanks! |
Beta Was this translation helpful? Give feedback.
1 reply
-
Thanks for passing it along @sampajano! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This isn't strictly a gRPC-web bug, but it's an incompatibility between the gRPC-web binary protocol and the developer tooling Google Chrome provides, so hopefully y'all can communicate internally 🙂 I don't have a lot of faith that my in-browser feedback will go anywhere.
Chrome's dev tools includes a very useful "Copy as cURL" tool to generate a
curl
command to reproduce a given request. However I've observed that the generated command is malformed for (some?) gRPC-web requests due to\0
bytes in the request body which bash and other shells, as well as Unix command lines, are incompatible with.Here's a sanitized example command generated by Chrome:
The payload is supposed to be passed via the
--data-raw
flag, however bash doesn't support\0
bytes in strings and so this ends up as an empty string. Demo:This causes the request to fail - including
-v
in thecurl
command shows the following response headers:I believe the only way to send
\0
bytes viacurl
is reading from a file / stdin, something like:Beta Was this translation helpful? Give feedback.
All reactions