Follow redirects for check if document is https. #105

Merged
merged 2 commits into from Jan 11, 2017

Projects

None yet

2 participants

@tobli
Collaborator
tobli commented Jan 10, 2017

This gives more useful information for pages that does an initial http->https redirect. Previously the page would be considered http, thus not warning about non-https assets on the page.

@tobli tobli requested a review from micmro Jan 10, 2017
@tobli tobli Follow redirects for check if document is https.
This gives more useful information for pages that does an initial http->https redirect. Previously the page would be considered http, thus not warning about non-https assets on the page.
eea5aff
src/ts/helpers/heuristics.ts
+
+/**
+ * Check if the document (disregarding any initial http->https redirects) is loaded over a secure connection.
+ * @param data the waterfall data.
@micmro
micmro Jan 11, 2017 Owner

I think this should need to be:

@param {WaterfallData} data -  the waterfall data.

to fit the global patter.

@tobli
tobli Jan 11, 2017 Collaborator

Thanks, I'll fix before merge.

+ */
+export function documentIsSecure(data: WaterfallData) {
+ const rootDocument = data.entries.filter((e) => !e.rawResource.response.redirectURL)[0];
+ return isSecure(rootDocument);
@micmro
micmro Jan 11, 2017 Owner

I think isSecure is just used here, should we merge it or do you think there is some reuse?

@tobli
tobli Jan 11, 2017 Collaborator

It's used in svg-indicators.ts as well.

@micmro
micmro Jan 11, 2017 Owner

👍 great - was not aware of that.

@micmro
micmro approved these changes Jan 11, 2017 View changes

Great! Really good point.

@tobli tobli Fix JSDoc comment.
4283875
@tobli tobli merged commit eb10c99 into master Jan 11, 2017

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@tobli tobli deleted the doc-is-secure branch Jan 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment