Skip to content

fix(xml): preserve UTF-8 declaration in signed DPS output#18

Merged
vitormattos merged 1 commit intomainfrom
feat/artifact-exception-handling
Apr 17, 2026
Merged

fix(xml): preserve UTF-8 declaration in signed DPS output#18
vitormattos merged 1 commit intomainfrom
feat/artifact-exception-handling

Conversation

@vitormattos
Copy link
Copy Markdown
Member

Summary

Preserves an explicit UTF-8 XML declaration in signed DPS payloads returned by DpsSigner.

Why

Some downstream integrations expect the signed XML to retain a deterministic declaration line (<?xml version="1.0" encoding="UTF-8"?>).

Changes

  • src/Xml/DpsSigner.php
    • serialize only the document element
    • prepend explicit UTF-8 declaration
    • keep fallback to original input when serialization fails
  • tests/Unit/Xml/DpsSignerTest.php
    • add regression test asserting UTF-8 declaration prefix

Validation

  • vendor/bin/phpunit --filter='DpsSignerTest' --no-coverage
    • Passed: 10 tests, 63 assertions

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
@vitormattos vitormattos merged commit e8fd5bf into main Apr 17, 2026
10 checks passed
@vitormattos vitormattos deleted the feat/artifact-exception-handling branch April 17, 2026 03:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant