@cocreate/server-side-render 1.12.5 → 1.12.6

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 CHANGED
@@ -1,3 +1,10 @@
1
+ ## [1.12.6](https://github.com/CoCreate-app/CoCreate-server-side-render/compare/v1.12.5...v1.12.6) (2025-10-11)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * ensure pathname ends with a trailing slash for correct URL construction in HTML rendering ([5122e24](https://github.com/CoCreate-app/CoCreate-server-side-render/commit/5122e2413a986ebe51cb4a48ab92387aad4b5727))
7
+
1
8
  ## [1.12.5](https://github.com/CoCreate-app/CoCreate-server-side-render/compare/v1.12.4...v1.12.5) (2025-10-08)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/server-side-render",
3
- "version": "1.12.5",
3
+ "version": "1.12.6",
4
4
  "description": "A simple server-side-render component in vanilla javascript. Easily configured using HTML5 data-attributes and/or JavaScript API.",
5
5
  "keywords": [
6
6
  "server-side-render",
package/src/index.js CHANGED
@@ -107,8 +107,12 @@ class CoCreateServerSideRender {
107
107
  src = src.replaceAll(/\$relativePath\/?/g, path);
108
108
  }
109
109
 
110
+ let pathname = file.path
111
+ if (!pathname.endsWith("/")) {
112
+ pathname += "/";
113
+ }
110
114
  // Construct actual pathname using src and the original URL
111
- let pathname = new URL(src, `http://localhost${file.path}`)
115
+ pathname = new URL(src, `http://localhost${pathname}`)
112
116
  .pathname;
113
117
 
114
118
  if (pathname.endsWith("/")) {