mirror of https://github.com/grpc/grpc-go.git
				
				
				
			check content-type == application/grpc
This commit is contained in:
		
							parent
							
								
									4bd040ce23
								
							
						
					
					
						commit
						ccfc0efd97
					
				|  | @ -140,6 +140,11 @@ func newHPACKDecoder() *hpackDecoder { | |||
| 	d := &hpackDecoder{} | ||||
| 	d.h = hpack.NewDecoder(http2InitHeaderTableSize, func(f hpack.HeaderField) { | ||||
| 		switch f.Name { | ||||
| 		case "content-type": | ||||
| 			if !strings.Contains(f.Value, "application/grpc") { | ||||
| 				d.err = StreamErrorf(codes.FailedPrecondition, "transport: received the unexpected header") | ||||
| 				return | ||||
| 			} | ||||
| 		case "grpc-status": | ||||
| 			code, err := strconv.Atoi(f.Value) | ||||
| 			if err != nil { | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue