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

Another flash of unstyled content #927

Merged
merged 3 commits into from
Apr 12, 2017

Conversation

drewpc
Copy link
Collaborator

@drewpc drewpc commented Apr 11, 2017

This fix builds on the work in #501 and handles the case where the below URLs are seen as different, thereby creating a flash of unstyled content:

http://0.0.0.0:3001/common.css
//0.0.0.0:3001/common.css

… ClientCssHelper key by removing the protocol from the key url.
}

console.log('after modification: ', url);
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like a debug statement got left in.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

gah!

if (typeof url === 'string') {
url = url
.replace(/^http[s]?:/, '')
.replace(new RegExp("^\/\/" + urlBase), '');
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice!

@@ -96,14 +96,18 @@ module.exports = {
}

function normalizeLocalUrl(url) {
const urlBase = location.protocol + "//" + location.host;
const urlBase = location.host + (location.port ? ':' + location.port : '');
Copy link
Contributor

Choose a reason for hiding this comment

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

I think host should actually have the port included.

https://developer.mozilla.org/en-US/docs/Web/API/Location
image

@gigabo gigabo added the bug An issue with the system label Apr 11, 2017
@drewpc drewpc merged commit 1c43763 into redfin:master Apr 12, 2017
@drewpc drewpc deleted the patch-fix-clientcsshelper-key-issue branch April 12, 2017 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue with the system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants