(t *testing.T, e env)
| 6074 | } |
| 6075 | |
| 6076 | func testServerMaxHeaderListSizeClientIntentionalViolation(t *testing.T, e env) { |
| 6077 | te := newTest(t, e) |
| 6078 | te.maxServerHeaderListSize = new(uint32) |
| 6079 | *te.maxServerHeaderListSize = 512 |
| 6080 | te.startServer(&testServer{security: e.security}) |
| 6081 | defer te.tearDown() |
| 6082 | |
| 6083 | cc, dw := te.clientConnWithConnControl() |
| 6084 | tc := &testServiceClientWrapper{TestServiceClient: testgrpc.NewTestServiceClient(cc)} |
| 6085 | ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout) |
| 6086 | defer cancel() |
| 6087 | stream, err := tc.FullDuplexCall(ctx) |
| 6088 | if err != nil { |
| 6089 | t.Fatalf("%v.FullDuplexCall(_) = _, %v, want _, <nil>", tc, err) |
| 6090 | } |
| 6091 | rcw := dw.getRawConnWrapper() |
| 6092 | val := make([]string, 512) |
| 6093 | for i := range val { |
| 6094 | val[i] = "a" |
| 6095 | } |
| 6096 | // allow for client to send the initial header |
| 6097 | time.Sleep(100 * time.Millisecond) |
| 6098 | rcw.writeHeaders(http2.HeadersFrameParam{ |
| 6099 | StreamID: tc.getCurrentStreamID(), |
| 6100 | BlockFragment: rcw.encodeHeader("oversize", strings.Join(val, "")), |
| 6101 | EndStream: false, |
| 6102 | EndHeaders: true, |
| 6103 | }) |
| 6104 | if _, err := stream.Recv(); err == nil || status.Code(err) != codes.Internal { |
| 6105 | t.Fatalf("stream.Recv() = _, %v, want _, error code: %v", err, codes.Internal) |
| 6106 | } |
| 6107 | } |
| 6108 | |
| 6109 | func (s) TestClientMaxHeaderListSizeServerIntentionalViolation(t *testing.T) { |
| 6110 | for _, e := range listTestEnv() { |
no test coverage detected