Send Entire Request, Including Query Params, To Prerender #40
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Prerender accepts query params and allows them to influence the prerendered page content, see https://docs.prerender.io/docs/ignore-config. Some applications require this behavior
Solution
Send the query params along in the prerendered request
This behavior was removed in the previous version of this repository here jeroennoten/Laravel-Prerender#9. It's not exactly clear to me how this solves an ELB http/https issue, as
fullUrl()
likewise differentiates between the two using$request->isSecure()
, so I'm not sure how or if this would reintroduce that issueThe only other change this makes is that when requesting the page at
/
, the new logic no longer sends a trailing slash (something likehttps://service.prerender.io/http%3A%2F%2Flocalhost
rather thanhttps://service.prerender.io/http%3A%2F%2Flocalhost%2F
). All other urls should remain the same, with the exception of query paramsIf either of these may be an issue, we could also append the query string to the prexisting logic with
$request->getQueryString()
instead of usingfullUrl()
, I just figured the latter would be simpler