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

Conditionally append parameters to GET requests #74

Merged
merged 1 commit into from
Jul 15, 2024

Conversation

n7studios
Copy link
Contributor

Summary

Conditionally appends parameters to GET requests, as some requests with no parameters resulted in ? being appended and a redirect being performed as part of the API request:

Screenshot 2024-07-10 at 16 15 56

Testing

Existing tests pass.

Checklist

@n7studios n7studios added the enhancement New feature or request label Jul 10, 2024
@n7studios n7studios self-assigned this Jul 10, 2024
@n7studios n7studios requested review from a team, noelherrick and corydhmiller and removed request for a team July 12, 2024 01:39
@n7studios n7studios marked this pull request as ready for review July 12, 2024 01:39
Copy link

@noelherrick noelherrick left a comment

Choose a reason for hiding this comment

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

Thoughts on standardizing on a library for URI manipulation (some light googling brought up https://uri.thephpleague.com/)? I don't know how often it comes up but it might avoid issues such as this.

@n7studios
Copy link
Contributor Author

Thoughts on standardizing on a library for URI manipulation (some light googling brought up https://uri.thephpleague.com/)? I don't know how often it comes up but it might avoid issues such as this.

I don't think it's needed. We're using WordPress standard wp_remote_* functions, which handle most URI manipulation here. I'll likely submit a patch to the WordPress core trac to have this handled upstream in their HTTP request functions.

@n7studios n7studios merged commit 7736b19 into main Jul 15, 2024
5 checks passed
@n7studios n7studios deleted the conditionally-append-get-params branch July 19, 2024 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants