Skip to content

Fix incorrect HTTP referer on hard loads #397

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

AlexHill
Copy link
Contributor

@AlexHill AlexHill commented Jun 5, 2014

Instead of calling location.replace() in locationReplace, call history.back() and then location.assign(). This means the new page will be loaded with the correct HTTP referer – the previous page's URL.

onPjaxPopstate() shouldn't do anything when we call history.back(), because the popped state will be equal to pjax.state.

@@ -376,8 +376,12 @@ function pjaxReload(container, options) {
//
// Returns nothing.
function locationReplace(url) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In light of these changes, calling this function locationReplace doesn't make a huge amount of sense. I suggest renaming it hardLoad, which describes the functionality rather than the (old) implementation.

@staabm
Copy link
Contributor

staabm commented Dec 4, 2014

@mislav any progress on this?

@mislav
Copy link
Collaborator

mislav commented Dec 4, 2014

I will need to look into this. Thanks for the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants