Skip to content

Commit

Permalink
Fix issue with origin containing a path not finishing with /
Browse files Browse the repository at this point in the history
  • Loading branch information
Robin Goupil committed May 24, 2021
1 parent 25d8df1 commit 3376065
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
3 changes: 3 additions & 0 deletions index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ export function ReactSRMWrapper({
const [srmMethods, setSrmMethods] = useState<SRMMethods | undefined>(undefined);

const initialize = async () => {
if (originUrl && !originUrl.endsWith('/')) {
originUrl += '/';
}
await ResourceFetcherService.loadSRM(originUrl);

loaded?.(anchorEl.current!);
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@
"scripts": {
"build": "microbundle-crl --format cjs",
"start": "microbundle-crl watch --m --no-compress --format cjs",
"prepare": "run-s build",
"prepare": "run-s build && yarn test && cd example && yarn install && yarn run build",
"test": "run-s test:unit test:lint test:build",
"test:build": "run-s build",
"test:lint": "eslint .",
"test:unit": "cross-env CI=1 react-scripts test --env=jsdom",
"test:watch": "react-scripts test --env=jsdom",
"predeploy": "cd example && yarn install && yarn run build",
"deploy": "gh-pages -d example/build"
},
"peerDependencies": {
Expand Down
8 changes: 7 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@
"noUnusedParameters": true,
"allowSyntheticDefaultImports": true,
"resolveJsonModule": true,
"strict": true
"strict": true,
"target": "es5",
"allowJs": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"isolatedModules": true,
"noEmit": true
},
"include": [
"."
Expand Down

0 comments on commit 3376065

Please sign in to comment.