Skip to content

Maintenance – Change header x on behalf of#127

Open
derpixler wants to merge 2 commits into
masterfrom
maintenance/rr/64/change-header-x-on-behalf-of
Open

Maintenance – Change header x on behalf of#127
derpixler wants to merge 2 commits into
masterfrom
maintenance/rr/64/change-header-x-on-behalf-of

Conversation

@derpixler

Copy link
Copy Markdown
Contributor

What

Replaces the deprecated X-On-Behalf-Of HTTP header with From as required by Zammad >= 6.5.

Why

In Zammad 6.5, using X-On-Behalf-Of causes a 500 Internal Server Error because the
deprecation warning itself crashes. Zammad now expects the standard From header.
The documentation has already been updated (zammad/zammad-documentation#626).

Closes #64.

Changes

  • src/Client.php — Header renamed from X-On-Behalf-Of to From
  • README.md — Documentation updated to reference the From header
  • CHANGELOG.md — Entry added

Tests

  • test/ZammadAPIClient/ClientTest.php — 3 new mock-based unit tests covering:

    • From header is set when setOnBehalfOfUser() is called
    • From header is absent by default
    • From header is removed after unsetOnBehalfOfUser()
    • 1 integration test (testFromHeaderAgainstZammad) that verifies the header works against a real Zammad instance (skipped when env vars are not configured)
  • test/ZammadAPIClient/EnvConfigTrait.php — New trait providing getZammadConfig() and createZammadClient() to deduplicate environment-variable handling between AbstractBaseTest and ClientTest

  • test/ZammadAPIClient/Resource/AbstractBaseTest.php — Refactored to use EnvConfigTrait instead of inline env-var logic

Backward Compatibility

  • Method names setOnBehalfOfUser() and unsetOnBehalfOfUser() remain unchanged
  • From header is supported by Zammad pre-6.5 as well

@derpixler derpixler self-assigned this Jun 8, 2026
@derpixler derpixler changed the title Maintenance/rr/64/change header x on behalf of Maintenance – Change header x on behalf of Jun 9, 2026
@derpixler derpixler requested a review from mgruner June 9, 2026 07:44
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.

Use From instead of X-On-Behalf-Of

2 participants