dreamhead / moco

Easy Setup Stub Server
MIT License
4.36k stars 1.08k forks source link

SOAP 1.2 charset resolve #248

Open nikita-mishchenko opened 6 years ago

nikita-mishchenko commented 6 years ago

Hello, there is an issue with charset resolving for SOAP 1.2 requests. In SOAP 1.2 specification you have action defined in ContentType header and it could have value: text/xml; charset=utf-8; action="someaction". Moco use HttpUtil class from netty-codec-http to resolve and set encoding. HttpUtil class has method getCharsetAsSequence(CharSequence contentTypeValue) which finds word charset and take whole line from charset to the end. So from example above you will receive the following string: utf-8; action="someaction" and then exception java.nio.charset.IllegalCharsetNameException: utf-8; action...

huxin3420 commented 5 years ago

the moco-runner recognized that your charset is not 'utf-8' but 'utf-8;' , so it throw a exception named 'illegalchasetnameexception'. it means your charset name is wrong .

nikita-mishchenko commented 5 years ago

the moco-runner recognized that your charset is not 'utf-8' but 'utf-8;' , so it throw a exception named 'illegalchasetnameexception'. it means your charset name is wrong .

Please read problem description again. I checked where was a problem, and it's netty bug. I already report it(https://github.com/netty/netty/issues/8273) and looks like it's fixed now.

So you need to upgrade netty version. To fix this issue in moco.