mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
Allow for republish to be headers only
Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"math/rand"
|
||||
@@ -1326,3 +1327,21 @@ func (c *cluster) stableTotalSubs() (total int) {
|
||||
return nsubs
|
||||
|
||||
}
|
||||
|
||||
func addStream(t *testing.T, nc *nats.Conn, cfg *StreamConfig) *StreamInfo {
|
||||
t.Helper()
|
||||
req, err := json.Marshal(cfg)
|
||||
require_NoError(t, err)
|
||||
rmsg, err := nc.Request(fmt.Sprintf(JSApiStreamCreateT, cfg.Name), req, time.Second)
|
||||
require_NoError(t, err)
|
||||
var resp JSApiStreamCreateResponse
|
||||
err = json.Unmarshal(rmsg.Data, &resp)
|
||||
require_NoError(t, err)
|
||||
if resp.Type != JSApiStreamCreateResponseType {
|
||||
t.Fatalf("Invalid response type %s expected %s", resp.Type, JSApiStreamCreateResponseType)
|
||||
}
|
||||
if resp.Error != nil {
|
||||
t.Fatalf("Unexpected error: %+v", resp.Error)
|
||||
}
|
||||
return resp.StreamInfo
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user