Skip to content

Commit 06087d7

Browse files
Merge pull request #48 from mrvyldr/master
added slash for fragment source path
2 parents 9bbbb7b + e2fc31c commit 06087d7

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@puzzle-js/client-lib",
33
"main": "dist/index.js",
4-
"version": "1.6.5",
4+
"version": "1.6.6",
55
"author": "<[email protected]>",
66
"license": "MIT",
77
"repository": {

src/core.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ export class Core extends Module {
148148

149149
private static fetchGatewayFragment(fragment: IPageFragmentConfig) {
150150
const queryString = this.prepareQueryString(fragment.attributes);
151-
const fragmentRequestUrl = `${fragment.source}${(fragment.attributes.withoutPathname) ? '' : window.location.pathname}${queryString}`;
151+
const fragmentRequestUrl = `${fragment.source}${(fragment.attributes.withoutPathname) ? '/' : window.location.pathname}${queryString}`;
152152
return fetch(fragmentRequestUrl, {
153153
headers: {
154154
originalurl: window.location.pathname

test/core.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ describe('Module - Core', () => {
346346
await Core.renderAsyncFragment('test');
347347
await Core.renderAsyncFragment('test');
348348

349-
const fragmentRequestUrl = `${source}?__renderMode=stream&if=false&withoutPathname=true`;
349+
const fragmentRequestUrl = `${source}/?__renderMode=stream&if=false&withoutPathname=true`;
350350
expect(fetchStub.calledWith(fragmentRequestUrl, {
351351
headers: {
352352
originalurl: window.location.pathname

0 commit comments

Comments
 (0)