n8n-nodes-h2i 1.0.0 → 1.0.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.
@@ -5,6 +5,11 @@ exports.downloadToBinary = downloadToBinary;
5
5
  function stripTrailingSlash(url) {
6
6
  return url.endsWith('/') ? url.slice(0, -1) : url;
7
7
  }
8
+ function ensureLeadingSlash(path) {
9
+ if (!path)
10
+ return '/';
11
+ return path.startsWith('/') ? path : `/${path}`;
12
+ }
8
13
  async function davixRequest(options) {
9
14
  const creds = await this.getCredentials('davixH2IApi');
10
15
  const baseUrl = stripTrailingSlash(String(creds.baseUrl || ''));
@@ -15,7 +20,7 @@ async function davixRequest(options) {
15
20
  throw new Error('Missing API Key in credentials.');
16
21
  const requestOptions = {
17
22
  ...options,
18
- url: `${baseUrl}${options.url}`,
23
+ url: `${baseUrl}${ensureLeadingSlash(String(options.url || ''))}`,
19
24
  headers: {
20
25
  ...(options.headers || {}),
21
26
  // PixLab accepts x-api-key
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-h2i",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Davix H2I (PixLab) community node for n8n: H2I, Image, PDF, Tools endpoints",
5
5
  "license": "MIT",
6
6
  "keywords": [