shenyu icon indicating copy to clipboard operation
shenyu copied to clipboard

If the content-type is not set in the request header,WebClientPlugin will set "application/json" for default

Open xiongzegang opened this issue 5 years ago • 4 comments

Describe the bug

If the content-type is not set in the request header,WebClientPlugin will set "application/json" for default. This will trigger some exceptions。 for example: My controller function is like this: @GetMapping(value="/test/name") public Object getOjb() {} If the content-type is not set in the request header, an execption will throw: org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'application/json' not supported。 And I don't think gateway should change origin request header。

Environment

  • Soul version(s): 2.3.1-master
  • My service base on spring boot 2.1.5

xiongzegang avatar May 08 '21 00:05 xiongzegang

I think so, usually, the browser will set content-type to "application/x-www-form-urlencoded". If shenyu set the default value to "application/json", it may be inconsistent with expectations

ttttangzhen avatar May 08 '21 01:05 ttttangzhen

can you fix it?

yu199195 avatar May 08 '21 08:05 yu199195

can you fix it?

ok, I'll fix it this weekend

xiongzegang avatar May 08 '21 09:05 xiongzegang

can you fix it?

ok, I'll fix it this weekend

fixed in pr #1428

xiongzegang avatar May 09 '21 16:05 xiongzegang