Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Change links to use HTTPs #415

Merged
merged 2 commits into from
Oct 19, 2019
Merged

Change links to use HTTPs #415

merged 2 commits into from
Oct 19, 2019

Conversation

zschallz
Copy link
Contributor

  • Changed template links to use HTTPS
  • Added a test to ensure http:// isn't referenced anywhere in the templates unless it's whitelisted.

@@ -182,7 +182,6 @@ <h3>Discord</h3>
<p>
<a class="button-small" href="https://github.com/jmhobbs/terminal-parrot">Terminal</a>
<a class="button-small" href="https://github.com/Shrugs/partyparrot">Text-To-Parrots</a>
<a class="button-small" href="http://countryparrots.com/">Country Parrots</a>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a dead link, so I removed it.

@@ -211,15 +210,15 @@ <h3>Discord</h3>
</p>

<p>
<a class="button-small" href="http://kakaporecovery.org.nz/sirocco/">Donate To Keep Them Partying</a>
<a class="button-small" href="https://www.doc.govt.nz/kakapo-recovery">Donate To Keep Them Partying</a>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Domain kakaporecovery.org.nz doesn't seem to have an https certificate, but the link redirects to www.doc.govt.nz anyway, which does.

fileContents
.toString()
.match(/(http:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*))/gi);
httpLinks = httpLinks ? httpLinks : [];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

.match() returns null, but it's easier to deal with an empty array.

@jmhobbs
Copy link
Owner

jmhobbs commented Oct 19, 2019

Top notch stuff, thanks for the effort on this!

@jmhobbs jmhobbs merged commit 8049dbe into jmhobbs:master Oct 19, 2019

describe("HTML templates", function() {
it("should not contain un-whitelisted http://", function() {
const whiteList = ['http://www.gtfoparrot.com/'];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

No choice here- gtfoparrot is hosted on google storage and has no HTTPS cert.

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

Successfully merging this pull request may close these issues.

2 participants