Skip to content

Resolve charset from ContentType header for SOAP 1.2 requests #8273

@nikita-mishchenko

Description

@nikita-mishchenko

Hello, there is a problem with charset resolution from ContentType header for SOAP 1.2 using io.netty.handler.codec.http.HttpUtils class. SOAP 1.2 could have action parameter in ContentType header and method getCharsetAsSequence(CharSequence contentTypeValue) from io.netty.handler.codec.http.HttpUtils class just finds charset word and take whole string from this word end to the end.

Expected behavior

Resolve charset from ContentType header with value text/xml; charset=utf-8; action="someaction" as UTF-8

Actual behavior

Resolve charset substring from ContentType header with value text/xml; charset=utf-8; action="someaction" as utf-8; action="someaction". And then you will get an exception java.nio.charset.IllegalCharsetNameException

Steps to reproduce

Resolve charset from any request which contains action parameter in ContentType header value

Netty version

4.1.19

JVM version (e.g. java -version)

java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)

OS version (e.g. uname -a)

Linux 4.15.0-33-generic Ubuntu 18

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions