Skip to content

Clean up proxy.php by extracting request, status, and streaming helpers#341

Open
joshtrichards wants to merge 18 commits intoCollaboraOnline:masterfrom
joshtrichards:jtr/refactor-orders-and-helpers
Open

Clean up proxy.php by extracting request, status, and streaming helpers#341
joshtrichards wants to merge 18 commits intoCollaboraOnline:masterfrom
joshtrichards:jtr/refactor-orders-and-helpers

Conversation

@joshtrichards
Copy link
Copy Markdown
Contributor

Summary

This branch is a refactor/cleanup of proxy.php with no intended functional change. It improves readability and maintainability by reorganizing the script into focused helper functions, consolidating the main flow, and clarifying comments and names.

  • Extracts status handling, request parsing, multipart reconstruction, header forwarding, and response streaming into dedicated helpers.
  • Replaces the custom startsWith() helper with native str_starts_with().
  • Renames key variables and functions for consistency and readability.
  • Clarifies comments and debug messages without intentionally changing proxy behavior.
  • Adds type hints where practical.

Notes for reviewers

This is intended to be a structural refactor for readability and maintainability, so review is easiest by comparing control-flow equivalence between the extracted helpers and the prior inline logic. Each extraction is also in its own commit to further ease reviewability.

Tested locally with Nextcloud v33.

@joshtrichards joshtrichards marked this pull request as ready for review May 8, 2026 17:58
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