Skip to content

[W-12688568] Missing protocol on baseUrl #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@api-components/api-request",
"description": "A set of composite components that are used to build an HTTP request editor with the support of the AMF model.",
"version": "0.3.3",
"version": "0.3.4",
"license": "Apache-2.0",
"main": "index.js",
"module": "index.js",
Expand Down Expand Up @@ -39,7 +39,7 @@
"@advanced-rest-client/uuid-generator": "^3.1.1",
"@anypoint-web-components/anypoint-button": "^1.1.1",
"@anypoint-web-components/anypoint-item": "^1.1.0",
"@api-components/amf-helper-mixin": "^4.3.4",
"@api-components/amf-helper-mixin": "^4.5.23",
"@api-components/api-authorization": "^0.7.1",
"@api-components/api-body-editor": "^4.0.5",
"@api-components/api-forms": "^0.2.1",
Expand Down
2 changes: 1 addition & 1 deletion src/ApiRequestEditorElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ export class ApiRequestEditorElement extends AmfHelperMixin(EventsTargetMixin(Li
if (old === value) {
return;
}
this._baseUri = value;
this._baseUri = this._ensureUrlScheme(value);
this.readUrlData();
this.requestUpdate('baseUri', old);
}
Expand Down
5 changes: 5 additions & 0 deletions test/ApiRequestEditorElement.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -976,6 +976,11 @@ describe('ApiRequestEditorElement', () => {
await nextFrame();
assert.isDefined(element.server);
});

it('sets protocol to uri if missing', () => {
element.baseUri = 'example.org';
assert.equal(element.baseUri, 'https://example.org');
});
});

describe('from navigation events', () => {
Expand Down