@fluid-app/fluid-cli-theme-dev 0.1.241 → 0.1.243
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +14 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -6615,6 +6615,13 @@ function summarizeCss(css) {
|
|
|
6615
6615
|
customProperties: countMatches(css, /(?:^|[;{\s])--[a-z0-9-]+\s*:/gi)
|
|
6616
6616
|
};
|
|
6617
6617
|
}
|
|
6618
|
+
function headerRecord(headers) {
|
|
6619
|
+
const record = {};
|
|
6620
|
+
headers.forEach((value, name) => {
|
|
6621
|
+
record[name.toLowerCase()] = value;
|
|
6622
|
+
});
|
|
6623
|
+
return record;
|
|
6624
|
+
}
|
|
6618
6625
|
const REDIRECT_STATUSES$1 = new Set([
|
|
6619
6626
|
301,
|
|
6620
6627
|
302,
|
|
@@ -6666,7 +6673,7 @@ async function readTextCapped(response, maxBytes) {
|
|
|
6666
6673
|
* fetch is pinned to the addresses that passed so DNS cannot be rebound
|
|
6667
6674
|
* between validation and connection.
|
|
6668
6675
|
*/
|
|
6669
|
-
async function fetchPublicText(rawUrl, timeoutMs = FETCH_TIMEOUT_MS, maxBytes = MAX_SINGLE_CSS_BYTES, attempt = 0) {
|
|
6676
|
+
async function fetchPublicText(rawUrl, timeoutMs = FETCH_TIMEOUT_MS, maxBytes = MAX_SINGLE_CSS_BYTES, attempt = 0, options = {}) {
|
|
6670
6677
|
const controller = new AbortController();
|
|
6671
6678
|
const timer = setTimeout(() => controller.abort(), timeoutMs);
|
|
6672
6679
|
let currentUrl = rawUrl;
|
|
@@ -6684,7 +6691,7 @@ async function fetchPublicText(rawUrl, timeoutMs = FETCH_TIMEOUT_MS, maxBytes =
|
|
|
6684
6691
|
const pinned = await pinnedPublicFetch(validation.url, validation.addresses, {
|
|
6685
6692
|
signal: controller.signal,
|
|
6686
6693
|
headers: {
|
|
6687
|
-
Accept: "text/css,text/html;q=0.9,*/*;q=0.1",
|
|
6694
|
+
Accept: options.accept ?? "text/css,text/html;q=0.9,*/*;q=0.1",
|
|
6688
6695
|
"User-Agent": USER_AGENT
|
|
6689
6696
|
}
|
|
6690
6697
|
});
|
|
@@ -6705,7 +6712,7 @@ async function fetchPublicText(rawUrl, timeoutMs = FETCH_TIMEOUT_MS, maxBytes =
|
|
|
6705
6712
|
if (!response.ok) {
|
|
6706
6713
|
if (RETRY_STATUSES.has(response.status) && attempt === 0) {
|
|
6707
6714
|
await new Promise((resolve) => setTimeout(resolve, RETRY_DELAY_MS));
|
|
6708
|
-
return fetchPublicText(rawUrl, timeoutMs, maxBytes, 1);
|
|
6715
|
+
return fetchPublicText(rawUrl, timeoutMs, maxBytes, 1, options);
|
|
6709
6716
|
}
|
|
6710
6717
|
return {
|
|
6711
6718
|
ok: false,
|
|
@@ -6713,7 +6720,8 @@ async function fetchPublicText(rawUrl, timeoutMs = FETCH_TIMEOUT_MS, maxBytes =
|
|
|
6713
6720
|
body: "",
|
|
6714
6721
|
finalUrl: currentUrl,
|
|
6715
6722
|
truncated: false,
|
|
6716
|
-
error: `HTTP ${response.status}
|
|
6723
|
+
error: `HTTP ${response.status}`,
|
|
6724
|
+
headers: headerRecord(response.headers)
|
|
6717
6725
|
};
|
|
6718
6726
|
}
|
|
6719
6727
|
const read = await readTextCapped(response, maxBytes);
|
|
@@ -6722,7 +6730,8 @@ async function fetchPublicText(rawUrl, timeoutMs = FETCH_TIMEOUT_MS, maxBytes =
|
|
|
6722
6730
|
status: response.status,
|
|
6723
6731
|
body: read.text,
|
|
6724
6732
|
finalUrl: currentUrl,
|
|
6725
|
-
truncated: read.truncated
|
|
6733
|
+
truncated: read.truncated,
|
|
6734
|
+
headers: headerRecord(response.headers)
|
|
6726
6735
|
};
|
|
6727
6736
|
} finally {
|
|
6728
6737
|
await pinned.close();
|