@hashrytech/quick-components-kit 0.15.0 → 0.15.2
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/CHANGELOG.md +12 -0
- package/dist/modules/api-proxy.js +2 -2
- package/dist/modules/fetch-client.js +2 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,7 +6,7 @@ export const defaultResponseHeaders = ['content-type', 'content-length', 'cache-
|
|
|
6
6
|
*/
|
|
7
7
|
export function createProxyHandlers(config) {
|
|
8
8
|
if (config.debug)
|
|
9
|
-
console.debug("Creating proxy handlers with config:", config);
|
|
9
|
+
console.debug("API Proxy: Creating proxy handlers with config:", config);
|
|
10
10
|
async function handler(event) {
|
|
11
11
|
const path = event.params.path;
|
|
12
12
|
const queryString = event.url.searchParams.toString();
|
|
@@ -14,7 +14,7 @@ export function createProxyHandlers(config) {
|
|
|
14
14
|
const fullPath = `/${path}${slash}${queryString ? `?${queryString}` : ''}`;
|
|
15
15
|
const url = `${config.host}${fullPath}`;
|
|
16
16
|
if (config.debug)
|
|
17
|
-
console.debug(`Proxying request to: ${url}`);
|
|
17
|
+
console.debug(`API Proxy: Proxying ${event.request.method} request to: ${url}`);
|
|
18
18
|
// Validate the path against allowed prefixes if specified
|
|
19
19
|
if (config.allowedPaths && config.allowedPaths.length > 0) {
|
|
20
20
|
const isAllowed = config.allowedPaths.some((prefix) => path?.startsWith(prefix));
|
|
@@ -119,6 +119,8 @@ export class FetchClient {
|
|
|
119
119
|
if (body instanceof FormData) {
|
|
120
120
|
requestHeaders.delete('Content-Type'); // Important: Let browser set Content-Type for FormData
|
|
121
121
|
processedBody = body;
|
|
122
|
+
if (this.debug)
|
|
123
|
+
console.debug(`Fetch Client: Removed Content-Type header since FormData is being used for body in request to ${url}`);
|
|
122
124
|
}
|
|
123
125
|
else if (body !== undefined && body !== null) {
|
|
124
126
|
const contentType = requestHeaders.get('Content-Type');
|