Skip to content

Commit

Permalink
Fix punycode
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicell committed Jun 23, 2023
1 parent 0a5dd3c commit 1112b13
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions public/punycode.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import Layout from "../layouts/Layout.astro";
<Layout title="URL Lengthener: l62.ng">
<link rel="preload" href="https://cdn.jsdelivr.net/npm/toastify-js/src/toastify.min.css" as="style" onload="this.onload=null;this.rel='stylesheet'">
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/toastify-js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/punycode@2.3.0/punycode.min.js"></script>
<script src="/punycode.js" is:inline></script>
<script is:inline>
var bases = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/', '='];
function longer() {
var website = document.getElementById("website").value;
var strippedURL = website.replace(/^(https?:\/\/)?([^\/]+).*/, "$2");
website = punycode.toASCII(strippedURL);
var strippedURL = website.replace(/^(https?:\/\/)?([^\/]+).*/, "$2");
website = punycode.toASCII(strippedURL);
try {
var urled = new URL(website);
// Make sure the URL is http or https
Expand Down

0 comments on commit 1112b13

Please sign in to comment.