-
-
Notifications
You must be signed in to change notification settings - Fork 273
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
template error when using --binary-file #284
Comments
Hmm I am a little confused by the steps to reproduce as it's using if we have a service definition like: syntax = "proto3";
package wrapped;
option go_package = "internal/wrapped";
import "google/protobuf/wrappers.proto";
service WrappedService {
rpc GetBytesMessage (google.protobuf.BytesValue) returns (google.protobuf.BytesValue);
} This works: protoMsg := wrappers.BytesValue{Value: []byte("Hello World!")}
msg, err := proto.Marshal(&protoMsg)
report, err := Run(
"wrapped.WrappedService.GetBytesMessage",
WithProtoFile("../testdata/wrapped.proto", []string{"../testdata"}),
WithBinaryData(msg),
// ...
) Similarly we can write the data to a file and use |
As mentioned, the problem happens when the byte sequence, by bad luck, contains something that looks like a |
do not attempt template actions with binary data. fixes #284
Hello, sorry I misunderstood the issue... This should be fixed in v0.98.0. If there are more problems with this feel free to reopen or create a new issue. |
Awesome! Thanks for taking the time to address this. |
Proto file(s)
Anything with a
bytes
field. BytesValue for example.Command line arguments / config
--binary-file
Describe the bug
Binary protobuf messages with bytes fields cause template errors like this:
If the bytes happen to contain character sequences that look like
template
directives.The problem
template
call seems to be hereTo Reproduce
Here's a test that produces the error.
Expected behavior
Binary messages provided via
--binary
or--binary-file
are not processed bytemplate
and work regardless of what byte patterns they happen to have.Environment
The text was updated successfully, but these errors were encountered: