You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by sh...@apache.org on 2021/04/23 09:12:34 UTC
[echarts-website] branch asf-site updated: add url encode
This is an automated email from the ASF dual-hosted git repository.
shenyi pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/echarts-website.git
The following commit(s) were added to refs/heads/asf-site by this push:
new 4dd5cad add url encode
4dd5cad is described below
commit 4dd5cad5fb5cdea3e6383050318de689dcc44043
Author: pissang <bm...@gmail.com>
AuthorDate: Fri Apr 23 17:12:19 2021 +0800
add url encode
---
.scripts/checkLinks.js | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/.scripts/checkLinks.js b/.scripts/checkLinks.js
index 4364656..cdbf4ad 100644
--- a/.scripts/checkLinks.js
+++ b/.scripts/checkLinks.js
@@ -16,7 +16,7 @@ function getPurgeUrl(fileUrl) {
}
// Only reject when url is 403. Don't check if url is 404 or other status
function checkIsUrl403(url) {
- return fetch(url, {
+ return fetch(encodeURI(url), {
method: 'HEAD'
}).then(response => {
console.log('Check', url, response.status);
@@ -27,7 +27,7 @@ function checkIsUrl403(url) {
}
function purgeUrl(url) {
- return fetch(url).then(response => response.json())
+ return fetch(encodeURI(url)).then(response => response.json())
.then(json => {
if (json.success) {
console.log('Purge Success', url);
@@ -74,7 +74,7 @@ async function run() {
const files403 = await find403Urls(files);
let successPurged = 0;
if (files403.length) {
- console.log(`Purging ${files403.length} 403 Urls`);
+ console.log(`Purging ${files403.length} 403 URLs`);
const totalLen = files403.length;
let finished = 0;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org