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

Require HTTPS before trusting publisher payment information #109

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

Require HTTPS before trusting publisher payment information #109

wants to merge 2 commits into from

Conversation

da2x
Copy link
Contributor

@da2x da2x commented Feb 16, 2017

Resolves issue #104 (which has the details about this).

(I also snuck in support for HTTP 304 caching.)

@@ -109,6 +111,15 @@ export function parseTxt() {
serialInfo.prevTime = Date.now().toString();
localStorage.setItem(document.domain, JSON.stringify(serialInfo));
}
} if (req.status == 304) {
info = localStorage.getItem(document.domain);
if (info !== undefined || info !== '') {
Copy link
Contributor

Choose a reason for hiding this comment

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

Too nested here. In the last else clause, there is another info = localStorage.getItem(document.domain), which also needs a check if info is not empty. Actually, these steps could be packaged into {getInfo, updateInfo, initInfo} (local operation) and syncInfo (remote operation). The if (info != null) check afterward can be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(I don’t get emails from this repo, so I’m not notified of the review.) You’re complaining about existing code and not my code changes, right? I’m checking to make sure there is a locally stored item (cached information) before updating the prevTime. All other uses of setItem replaces the existing item where as this updates the item already in storage. I can refactor everything here, but that would be a separate issue.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, to be precise. The diff algo / git-blame couldn't capture that the lines are being moved instead of rewritten. Yes, it was a cleanup request, and I could do it later as well once this PR is merged.

@rht
Copy link
Contributor

rht commented Feb 18, 2017

LGTM for https, LGTM for 304 (while the verbification stuff can be added later)

@rht
Copy link
Contributor

rht commented Feb 18, 2017

(needs a rebase)

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

Successfully merging this pull request may close these issues.

2 participants