(t *testing.T)
| 766 | } |
| 767 | |
| 768 | func TestDecodeReadRequestTooLarge(t *testing.T) { |
| 769 | // 5-byte snappy stream whose header claims 256 MiB decoded length, |
| 770 | // well above decodeReadLimit (32 MiB). |
| 771 | bomb := []byte{0x80, 0x80, 0x80, 0x80, 0x01} |
| 772 | req, err := http.NewRequest(http.MethodPost, "/", bytes.NewReader(bomb)) |
| 773 | require.NoError(t, err) |
| 774 | |
| 775 | _, err = DecodeReadRequest(req) |
| 776 | require.ErrorContains(t, err, "exceeds limit") |
| 777 | } |
| 778 | |
| 779 | func TestDecodeWriteRequest(t *testing.T) { |
| 780 | buf, _, _, err := buildWriteRequest(nil, writeRequestFixture.Timeseries, nil, nil, nil, nil, "snappy") |
nothing calls this directly
no test coverage detected
searching dependent graphs…