Skip to content
This repository has been archived by the owner on Mar 28, 2024. It is now read-only.

Commit

Permalink
Fix Invalid URL type error
Browse files Browse the repository at this point in the history
  • Loading branch information
jleifeld committed Jun 21, 2023
1 parent fe671d5 commit d3e0a67
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

All notable changes to this project will be documented in this file.

## [3.0.13] - 21.07.2023

## Fixed
- Fixed invalid URL type error

## [3.0.12] - 21.07.2023

## Fixed
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@shopware-ag/admin-extension-sdk",
"license": "MIT",
"version": "3.0.12",
"version": "3.0.13",
"repository": "git://github.com/shopware/admin-extension-sdk.git",
"description": "The SDK for App iframes to communicate with the Shopware Administration",
"keywords": [
Expand Down
4 changes: 4 additions & 0 deletions src/_internals/validator/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ export default function validate({
type: keyof ShopwareMessageTypes,
privilegesToCheck: (keyof privileges)[],
}): Error|null {
if (origin === undefined) {
return null;
}

const extension = findExtensionByBaseUrl(origin);

if (!extension) {
Expand Down
4 changes: 4 additions & 0 deletions src/privileges/privilege-resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ export function findExtensionByBaseUrl(baseUrl: string): extension | undefined {
return undefined;
}

if (baseUrl === '') {
return undefined;
}

const comparedBaseUrl = new URL(baseUrl);

/*
Expand Down

0 comments on commit d3e0a67

Please sign in to comment.