Skip to content

Code.Content-Type header#688

Merged
alexander-b-clean merged 8 commits into
devfrom
content-type-header.ab
Jul 23, 2026
Merged

Code.Content-Type header#688
alexander-b-clean merged 8 commits into
devfrom
content-type-header.ab

Conversation

@alexander-b-clean

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds centralized Content-Type handling for Remote Call responses in the CleantalkSP\SpbctWP\RemoteCalls layer, plus a PHPUnit test to validate the action→Content-Type mapping.

Changes:

  • Introduces a default response Content-Type constant and an action→Content-Type lookup table.
  • Sends a Content-Type header during remote call initialization based on spbc_remote_call_action.
  • Adds a PHPUnit test suite covering the resolver behavior for known actions and fallbacks.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
lib/CleantalkSP/SpbctWP/RemoteCalls.php Adds content-type constants/mapping, resolver, and header emission in the RC constructor.
tests/lib/CleantalkSP/SpbctWP/RemoteCalls/RemoteCallsContentTypeTest.php Adds unit tests validating content-type resolution for several remote-call actions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/CleantalkSP/SpbctWP/RemoteCalls.php
Comment thread lib/CleantalkSP/SpbctWP/RemoteCalls.php Outdated
Comment thread lib/CleantalkSP/SpbctWP/RemoteCalls.php
alexander-b-clean and others added 7 commits July 17, 2026 17:39
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@alexander-b-clean
alexander-b-clean merged commit 0414fd3 into dev Jul 23, 2026
7 checks passed
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.

5 participants