@szymonpiatek/nextwordpress 0.0.9 → 0.0.10
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/hooks/index.cjs +2 -2
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.js +2 -2
- package/dist/hooks/index.js.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -187,7 +187,7 @@ function createFetcher(config) {
|
|
|
187
187
|
"User-Agent": USER_AGENT
|
|
188
188
|
};
|
|
189
189
|
if (authToken) {
|
|
190
|
-
headers["Authorization"] = `Bearer ${authToken}`;
|
|
190
|
+
headers["Authorization"] = authToken.startsWith("Basic ") || authToken.startsWith("Bearer ") ? authToken : `Bearer ${authToken}`;
|
|
191
191
|
}
|
|
192
192
|
const res = await doFetch(url, {
|
|
193
193
|
method,
|
|
@@ -205,7 +205,7 @@ function createFetcher(config) {
|
|
|
205
205
|
"Content-Disposition": `attachment; filename="${filename}"`,
|
|
206
206
|
"Content-Type": mimeType,
|
|
207
207
|
"User-Agent": USER_AGENT,
|
|
208
|
-
"Authorization": `Bearer ${authToken}`
|
|
208
|
+
"Authorization": authToken.startsWith("Basic ") || authToken.startsWith("Bearer ") ? authToken : `Bearer ${authToken}`
|
|
209
209
|
},
|
|
210
210
|
body: file,
|
|
211
211
|
cache: "no-store"
|