Skip to content

[collector]bugfix: honor XML response charset#4167

Open
hutiefang76 wants to merge 1 commit into
apache:masterfrom
hutiefang76:codex/fix-http-xml-charset
Open

[collector]bugfix: honor XML response charset#4167
hutiefang76 wants to merge 1 commit into
apache:masterfrom
hutiefang76:codex/fix-http-xml-charset

Conversation

@hutiefang76

Copy link
Copy Markdown

What's changed

Close #2852.

  • Decode XML HTTP responses with the charset from Content-Type when present.
  • Fall back to the XML declaration charset before using UTF-8.
  • Keep non-XML response parsing behavior unchanged.
  • Add regression coverage for ISO-8859-1 XML without an HTTP charset and unsupported XML charset fallback.

Verification

  • JAVA_HOME=$(/usr/libexec/java_home -v 25 2>/dev/null || /usr/libexec/java_home) ./mvnw -pl hertzbeat-collector/hertzbeat-collector-basic -am -Dtest=HttpCollectImplTest -Dsurefire.failIfNoSpecifiedTests=false test
  • JAVA_HOME=$(/usr/libexec/java_home -v 25 2>/dev/null || /usr/libexec/java_home) ./mvnw -pl hertzbeat-collector/hertzbeat-collector-basic -am test
  • git diff --check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] HttpCollectImpl XML parsing assumes UTF-8

1 participant