@unocss/preset-web-fonts 0.49.0 → 0.49.1

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.cjs CHANGED
@@ -91,7 +91,8 @@ const preset = (options = {}) => {
91
91
  async function importUrl(url) {
92
92
  if (inlineImports) {
93
93
  if (!importCache[url]) {
94
- const promise = customFetch ? customFetch(url) : (await import('ohmyfetch')).$fetch(url, { headers: {}, retry: 3 });
94
+ const userAgentWoff2 = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36";
95
+ const promise = customFetch ? customFetch(url) : (await import('ohmyfetch')).$fetch(url, { headers: { "User-Agent": userAgentWoff2 }, retry: 3 });
95
96
  importCache[url] = promise.catch((e) => {
96
97
  console.error("Failed to fetch web fonts");
97
98
  console.error(e);
package/dist/index.mjs CHANGED
@@ -87,7 +87,8 @@ const preset = (options = {}) => {
87
87
  async function importUrl(url) {
88
88
  if (inlineImports) {
89
89
  if (!importCache[url]) {
90
- const promise = customFetch ? customFetch(url) : (await import('ohmyfetch')).$fetch(url, { headers: {}, retry: 3 });
90
+ const userAgentWoff2 = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36";
91
+ const promise = customFetch ? customFetch(url) : (await import('ohmyfetch')).$fetch(url, { headers: { "User-Agent": userAgentWoff2 }, retry: 3 });
91
92
  importCache[url] = promise.catch((e) => {
92
93
  console.error("Failed to fetch web fonts");
93
94
  console.error(e);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/preset-web-fonts",
3
- "version": "0.49.0",
3
+ "version": "0.49.1",
4
4
  "description": "Web Fonts support for Uno CSS",
5
5
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -37,7 +37,7 @@
37
37
  "*.css"
38
38
  ],
39
39
  "dependencies": {
40
- "@unocss/core": "0.49.0",
40
+ "@unocss/core": "0.49.1",
41
41
  "ohmyfetch": "^0.4.21"
42
42
  },
43
43
  "scripts": {