Skip to content
This repository has been archived by the owner on Jul 28, 2024. It is now read-only.

Commit

Permalink
fix emulator
Browse files Browse the repository at this point in the history
Signed-off-by: Takeshi Yoneda <[email protected]>
  • Loading branch information
mathetake committed Oct 4, 2023
1 parent 7cd38c3 commit 36c775b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions examples/shared_data/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func TestData(t *testing.T) {

// Check Envoy logs.
logs := host.GetInfoLogs()
require.Contains(t, logs, "shared value: 10000001")
require.Contains(t, logs, "shared value: 1")

// Call OnHttpRequestHeaders again.
action = host.CallOnRequestHeaders(contextID, nil, false)
Expand All @@ -40,7 +40,7 @@ func TestData(t *testing.T) {

// Check Envoy logs.
logs = host.GetInfoLogs()
require.Contains(t, logs, "shared value: 10000003")
require.Contains(t, logs, "shared value: 3")
})
}

Expand Down
4 changes: 3 additions & 1 deletion proxywasm/proxytest/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,9 @@ func (r *rootHostEmulator) ProxyGetSharedData(keyData *byte, keySize int,
}

*returnValueSize = len(value.data)
*returnValueData = &value.data[0]
if len(value.data) > 0 {
*returnValueData = &value.data[0]
}
*returnCas = value.cas
return internal.StatusOK
}
Expand Down

0 comments on commit 36c775b

Please sign in to comment.