Skip to content
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

[]byte in query now uses base64.StdEncoding #565

Merged
merged 1 commit into from
Mar 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Here's the recommended process of contribution.
4. Make sure that your change follows best practices in Go
* [Effective Go](https://golang.org/doc/effective_go.html)
* [Go Code Review Comments](https://golang.org/wiki/CodeReviewComments)
5. Make sure that `make test` passes. (use swagger-codegen 2.1.6, not newer versions)
5. Make sure that `make test` passes. (use swagger-codegen 2.2.2, not newer versions)
6. Sign [a Contributor License Agreement](https://cla.developers.google.com/clas)
7. Open a pull request in Github

Expand Down
2 changes: 1 addition & 1 deletion runtime/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func Uint32(val string) (uint32, error) {
// Bytes converts the given string representation of a byte sequence into a slice of bytes
// A bytes sequence is encoded in URL-safe base64 without padding
func Bytes(val string) ([]byte, error) {
b, err := base64.RawURLEncoding.DecodeString(val)
b, err := base64.StdEncoding.DecodeString(val)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion runtime/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ func populateField(f reflect.Value, value string, props *proto.Properties) error
f.Field(0).SetString(value)
return nil
case "BytesValue":
bytesVal, err := base64.RawURLEncoding.DecodeString(value)
bytesVal, err := base64.StdEncoding.DecodeString(value)
if err != nil {
return fmt.Errorf("bad BytesValue: %s", value)
}
Expand Down
8 changes: 4 additions & 4 deletions runtime/query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func TestPopulateParameters(t *testing.T) {
"uint32_value": {"4"},
"bool_value": {"true"},
"string_value": {"str"},
"bytes_value": {"Ynl0ZXM"},
"bytes_value": {"Ynl0ZXM="},
"repeated_value": {"a", "b", "c"},
"enum_value": {"1"},
"repeated_enum": {"1", "2", "0"},
Expand All @@ -58,7 +58,7 @@ func TestPopulateParameters(t *testing.T) {
"wrapper_u_int32_value": {"4"},
"wrapper_bool_value": {"true"},
"wrapper_string_value": {"str"},
"wrapper_bytes_value": {"Ynl0ZXM"},
"wrapper_bytes_value": {"Ynl0ZXM="},
"map_value[key]": {"value"},
"map_value[second]": {"bar"},
"map_value[third]": {"zzz"},
Expand Down Expand Up @@ -137,7 +137,7 @@ func TestPopulateParameters(t *testing.T) {
"uint32Value": {"4"},
"boolValue": {"true"},
"stringValue": {"str"},
"bytesValue": {"Ynl0ZXM"},
"bytesValue": {"Ynl0ZXM="},
"repeatedValue": {"a", "b", "c"},
"enumValue": {"1"},
"repeatedEnum": {"1", "2", "0"},
Expand All @@ -151,7 +151,7 @@ func TestPopulateParameters(t *testing.T) {
"wrapperUInt32Value": {"4"},
"wrapperBoolValue": {"true"},
"wrapperStringValue": {"str"},
"wrapperBytesValue": {"Ynl0ZXM"},
"wrapperBytesValue": {"Ynl0ZXM="},
},
filter: utilities.NewDoubleArray(nil),
want: &proto3Message{
Expand Down