-
Notifications
You must be signed in to change notification settings - Fork 26.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Triple http limiting the size of the HTTP request and response #14246
Conversation
@oxsean PTAL |
...ttp12/src/main/java/org/apache/dubbo/remoting/http12/exception/HttpOverPayloadException.java
Show resolved
Hide resolved
# Conflicts: # dubbo-remoting/dubbo-remoting-http12/src/main/java/org/apache/dubbo/remoting/http12/netty4/h1/NettyHttp1Channel.java
...ing-http12/src/main/java/org/apache/dubbo/remoting/http12/h1/LimitedByteBufOutputStream.java
Outdated
Show resolved
Hide resolved
...ttp12/src/main/java/org/apache/dubbo/remoting/http12/exception/HttpOverPayloadException.java
Show resolved
Hide resolved
I think h2 respone also need limit respone size. |
...ttp12/src/main/java/org/apache/dubbo/remoting/http12/h1/Http1ServerUnaryChannelObserver.java
Outdated
Show resolved
Hide resolved
In http2:
|
A problem encountered is that errors may occur during serialization. At this time, if the header is written first, the status code will be 200, but the result is failure. |
Http2 no longer requires a content-length header, but some clients may use content-length to determine whether the data stream is complete. Therefore, refer to some common implementations in the industry to decide whether to add a content-length header to the http2 trailers, such as spring boot, tomcat, etc. |
…g should also be set when the http1 connection is disconnected
...o-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/TripleHeaderEnum.java
Show resolved
Hide resolved
...ing-http12/src/main/java/org/apache/dubbo/remoting/http12/h1/LimitedByteBufOutputStream.java
Outdated
Show resolved
Hide resolved
# Conflicts: # dubbo-remoting/dubbo-remoting-http12/src/main/java/org/apache/dubbo/remoting/http12/netty4/h1/NettyHttp1Channel.java # dubbo-remoting/dubbo-remoting-http12/src/main/java/org/apache/dubbo/remoting/http12/netty4/h2/NettyH2StreamChannel.java
LGTM. |
@EarthChen PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
What is the purpose of the change
refer: #14068
For example:
Success result:
![image](https://private-user-images.githubusercontent.com/18413695/334350907-70c1e96a-2c6b-441f-83c1-24c503c3f83c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQyOTI2NzcsIm5iZiI6MTcyNDI5MjM3NywicGF0aCI6Ii8xODQxMzY5NS8zMzQzNTA5MDctNzBjMWU5NmEtMmM2Yi00NDFmLTgzYzEtMjRjNTAzYzNmODNjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODIyVDAyMDYxN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWUyOTc1YTU4MzhmMGI3Y2I5MTljNjQ3ZTU2YzU0NWJmYjVjNWE4NGIwYWM3NTk0ZTZiYWI3ZWEwZDZmN2UwZGQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.KyYffAx5vFTMFsBmIMYhEbVX9SPCrTQ4I2YeaYvSI24)
Request body limit result:
![image](https://private-user-images.githubusercontent.com/18413695/334349350-c43f2be8-fa7e-4a0d-b6b5-3fc4a63a99ed.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQyOTI2NzcsIm5iZiI6MTcyNDI5MjM3NywicGF0aCI6Ii8xODQxMzY5NS8zMzQzNDkzNTAtYzQzZjJiZTgtZmE3ZS00YTBkLWI2YjUtM2ZjNGE2M2E5OWVkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODIyVDAyMDYxN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTRjYjJkNTM1ZmI3NTZjYjMxMDE3MmFjNDhiNTdiMzc0YTFmNTk2OWU0OGZlODQwOTVlMjI4NTdlM2JjMGQ4ZWImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.JPKxGU-ZJkNC3JZChD7SXc7sBLg-Dof_02MxvbmBztg)
Response body limit result:
![image](https://private-user-images.githubusercontent.com/18413695/334349139-c02c4445-8249-4b6c-b529-61138dcbc748.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQyOTI2NzcsIm5iZiI6MTcyNDI5MjM3NywicGF0aCI6Ii8xODQxMzY5NS8zMzQzNDkxMzktYzAyYzQ0NDUtODI0OS00YjZjLWI1MjktNjExMzhkY2JjNzQ4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODIyVDAyMDYxN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPThjNDg1MTg1NjM2Y2MyYmVkMDIwOGU1OWIzNDQwODA4MGRjYzJkMDcxMWE5OGRmOWFkYTJmNGQyYWVkOWIwNzUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.1fdb-IP3xnkXt_HlKrKNfGnZCvWdvzJr8S-FvMCknfM)
Brief changelog
Verifying this change
Checklist