chenBright opened a new pull request, #2469:
URL: https://github.com/apache/brpc/pull/2469

   ### What problem does this PR solve?
   
   Issue Number:
   
   Problem Summary:
   1. #2366 修复了HEAD请求的问题,但是一般情况下http 
service不会设置Content-Length,响应就不会包括Content-Length,没有达到HEAD请求的预期。
   2. #2319 
保证了Content-Type在HttpHeader是唯一的,那么在解包的时候,就不需要设置两次Content-Type了。https://github.com/apache/brpc/blob/dc9e786fbb5fd79f08b49fa8d55ec4e1a35f2125/src/brpc/details/http_message.cpp#L139-L143
   
   ### What is changed and the side effects?
   
   Changed:
   1. 
当响应HEAD请求时,优先使用用户设置的Content-Length。如果用户没有设置Content-Length,则使用content的长度作为Content-Length的值。
   2. 删除HttpMessage::on_headers_complete中重复设置Content-Type的重复逻辑。
   
   Side effects:
   - Performance effects(性能影响):
   
   - Breaking backward compatibility(向后兼容性): 
   
   ---
   ### Check List:
   - Please make sure your changes are compilable(请确保你的更改可以通过编译).
   - When providing us with a new feature, it is best to add related 
tests(如果你向我们增加一个新的功能, 请添加相关测试).
   - Please follow [Contributor Covenant Code of 
Conduct](../../master/CODE_OF_CONDUCT.md).(请遵循贡献者准则).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to