Skip to content

Commit f11c940

Browse files
committed
Use negotiated frameMax instead of relying on server settings
1 parent 96ede5d commit f11c940

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

test-browser/websocket.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -583,15 +583,16 @@ test("can set frameMax", async () => {
583583
const ch = await conn.channel()
584584
await ch.confirmSelect()
585585
const q = await ch.queue("")
586-
await q.publish("", { headers: { a: "a".repeat(15000) } })
586+
const headerValue = "a".repeat(conn.frameMax - 100) // leave some space for other parts of the frame
587+
await q.publish("", { headers: { a: headerValue } })
587588
const msg = await q.get()
588589
if (msg) {
589590
const props = msg.properties
590591
if (props) {
591592
const headers = props.headers
592593
if (headers) {
593594
const a = headers["a"] as string
594-
expect(a.length).toEqual(15000)
595+
expect(a.length).toEqual(headerValue.length)
595596
} else expect(headers).toBeTruthy()
596597
} else expect(props).toBeTruthy()
597598
} else expect(msg).toBeTruthy()

0 commit comments

Comments
 (0)