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

HTTP redirects to HTTPS audit doesn't work on android #2363

Closed
patrickhulce opened this issue May 25, 2017 · 11 comments · Fixed by #4661
Closed

HTTP redirects to HTTPS audit doesn't work on android #2363

patrickhulce opened this issue May 25, 2017 · 11 comments · Fixed by #4661
Assignees

Comments

@patrickhulce
Copy link
Collaborator

When you run Lighthouse on WPT or on any Android device, the security domain does not work properly and thus fails the HTTP redirect check, see this report as example.

We should do what we did for is on HTTPS and just check for the scheme.

@evenstensberg
Copy link
Contributor

Can work on this. Need more context around the meaning of WPT, as my best search results were 🎴 World Poker Tournament 🎴 .

We should do what we did for is on HTTPS and just check for the scheme.

Mind clarifying with relevant links and some more details?

@brendankenny
Copy link
Member

brendankenny commented May 30, 2017

World Poker Tournament

WPT is WebPagetest :D

Mind clarifying with relevant links and some more details?

for background, see discussion and changes to is-on-https.js in #1918

@patrickhulce
Copy link
Collaborator Author

Sure :) WPT stands for https://www.webpagetest.org/ which is open source and does performance testing as a service. We have a Lighthouse integration there that enables you to get a LH report along with your regular report when you run it on one of their mobile devices.

Unfortunately the security domain we use to tell if you are on a https doesn't work on android. We encountered this with the is-on-https audit too which we switched to just parse the URLs and check if the scheme is https instead of using the security domain (see #1918).

I'm thinking we do something similar for the http-redirect gatherer and don't use the security state but just check that the final URL has https scheme

@evenstensberg
Copy link
Contributor

Gotcha! Let me bring up a PR for that possibly due thursday. If you know where to fix at android I can do it there instead, either way is fine with me. ( If the android implementation is OSS )

@patrickhulce
Copy link
Collaborator Author

If you know where to fix at android

I wish it were that simple :D either way we've going to have to work around this here in LH quickly since a fix for Android Chrome won't necessarily get pushed out soon even if we had one today. If you're curious though you can take a look at the Chromium bug and poke around the Chromium code

@evenstensberg
Copy link
Contributor

This one:

const networkRecords = artifacts.networkRecords[Audit.DEFAULT_PASS];

Fetches all urls from network, or?

@patrickhulce
Copy link
Collaborator Author

Right, that audit checks that all requests in the default pass used https. To fix this one though, you probably won't even need to mess with network records you could just check the final url in the afterPass method of http-redirect gatherer

@evenstensberg
Copy link
Contributor

Yep, doing it right now. Watching how you're building up audits to better know the source code while at it

@evenstensberg
Copy link
Contributor

Left it at #2396 , please, do an extensive review, this seems too simple and could break stuff

@paulirish
Copy link
Member

The simple fix: in afterPass we evaluateAsync new URL(window.location).protocol === 'https:' instead of using Security domain.

I'm going to take this.

@kevmoo
Copy link

kevmoo commented Mar 1, 2018

@paulirish – would love a fix here 😄

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