yangyi04 opened a new issue #1647:
URL: https://github.com/apache/incubator-brpc/issues/1647


   **Describe the bug (描述bug)**
   我们在用brpc提供在线服务的时候遇到了个问题:
   客户发来的请求类型是Content-Type=application/octet-stream的protobuf,我们在解析的时候发生了400 Bad 
Request的错误,x-bd-error-code: 1003。err_str:Fail to parse http body as XXX, 
Invalid json format
   
![image](https://user-images.githubusercontent.com/96422747/146764871-28f7991f-dd9d-4faa-8a66-2b2717046384.png)
   
   
   **To Reproduce (复现方法)**
   
我查看了一下brpc的代码逻辑,brpc内部只认为proto、x-protobuf、grpc开头的content-type是proto,其他情况会强制转换成json而导致报错。
   
![image](https://user-images.githubusercontent.com/96422747/146765006-adb98e38-be66-4e15-93d0-288a5f7646d5.png)
   
   
   
   **Expected behavior (期望行为)**
   想问一下有没有支持Content-Type=application/octet-stream的办法?
   
   **Versions (各种版本)**
   OS:Ubuntu 18.04
   Compiler: gcc 7.5
   brpc: v1.0.0
   protobuf: 3
   
   **Additional context/screenshots (更多上下文/截图)**
   
   


-- 
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