-
Notifications
You must be signed in to change notification settings - Fork 756
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chrome's "Copy as cURL" does not work with gRPC-web #1394
Comments
@dimo414 Wow! Thanks for reporting this "subtle" issue.. 馃槃 I've filed a chrome bug and hope they might have an idea 馃槂 Thanks! |
Thanks for passing it along @sampajano! |
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:The text was updated successfully, but these errors were encountered: