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

Update unmarshalNBytes to return nil when len of value is zero #7088

Merged
merged 2 commits into from
May 22, 2024
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ For details about compatibility between different releases, see the **Commitment

- Increased the timeout for Basic Station gateways sending HTTP headers. There should now be enough time for embedded devices with little to no hardware acceleration to perform a TLS handshake. In particular, The Things Indoor Gateway can now connect to The Things Stack presenting a ECDSA certificate.
- Reconnect a gateway when the antenna gain is adjusted.
- JSON requests where the `eui` field is explicitly set to `null` are no longer converted to an array of zeros.

### Security

Expand Down
3 changes: 1 addition & 2 deletions pkg/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,7 @@ func unmarshalNBytes(s *jsonplugin.UnmarshalState, n int) []byte {

switch len(trimmed) {
case 0:
b := make([]byte, n)
return b
return nil
case hex.EncodedLen(n):
b, err := hex.DecodeString(trimmed)
if err != nil {
Expand Down
Loading