Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API_Rewrite: Only filter 'pre_http_request' when API rewriting is enabled #306

Conversation

costdev
Copy link
Contributor

@costdev costdev commented Feb 21, 2025

Pull Request

What changed?

  • Added a check to ensure API rewriting is enabled before hooking 'pre_http_request'.
  • Adjusted an existing API_Rewrite test to enable API rewriting.
  • Added an API_Rewrite test to check that the hook is not added when API rewriting is disabled.

Why did it change?

The filter should only be applied when API rewriting is enabled.

This was causing errors on several screens when API rewriting was disabled.

Did you fix any specific issues?

Fixes #305

CERTIFICATION

By opening this pull request, I do agree to abide by the Code of Conduct and be bound by the terms of the Contribution Guidelines in effect on the date and time of my contribution as proven by the revision information in GitHub.

@costdev costdev force-pushed the only_filter_pre_http_request_when_rewriting_is_enabled branch from 9b2c4d0 to c180e11 Compare February 21, 2025 04:14
@costdev costdev marked this pull request as ready for review February 21, 2025 04:26
@costdev costdev requested review from namithj and afragen February 21, 2025 04:28
@costdev costdev merged commit 63f1cc2 into aspirepress:main Feb 21, 2025
6 checks passed
@costdev costdev deleted the only_filter_pre_http_request_when_rewriting_is_enabled branch February 21, 2025 04:29
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.

[Bug] API_Rewrite::pre_http_request() runs even when API rewriting is disabled.
2 participants