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

Commit

Permalink
Use correct variable for API Origin
Browse files Browse the repository at this point in the history
Previously we were reading `config.source` and then removing the
trailing slash. However, this doesn't include the port, which we use
when running locally. `config['puter.api_origin']` is actually what we
want, which does have the port if it's set, and doesn't include the
trailing slash either.
  • Loading branch information
AtkinsSJ committed Apr 3, 2024
1 parent 032de90 commit 3029cc1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
5 changes: 1 addition & 4 deletions src/main_puter.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,7 @@ window.main_shell = async () => {
if ( config['puter.auth.token'] ) {
await puterSDK.setAuthToken(config['puter.auth.token']);
}
const source_without_trailing_slash =
(config.source && config.source.replace(/\/$/, ''))
|| 'https://api.puter.com';
await puterSDK.setAPIOrigin(source_without_trailing_slash);
await puterSDK.setAPIOrigin(config['puter.api_origin']);

const ptt = new XDocumentPTT();
await launchPuterShell(new Context({
Expand Down
5 changes: 1 addition & 4 deletions src/puter-shell/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,7 @@ export const launchPuterShell = async (ctx) => {
const sdkv2 = globalThis.puter;
if ( ctx.platform.name !== 'node' ) {
await sdkv2.setAuthToken(config['puter.auth.token']);
const source_without_trailing_slash =
(config.source && config.source.replace(/\/$/, ''))
|| 'https://api.puter.com';
await sdkv2.setAPIOrigin(source_without_trailing_slash);
await sdkv2.setAPIOrigin(config['puter.api_origin']);
}

// const commandProvider = new BuiltinCommandProvider();
Expand Down

0 comments on commit 3029cc1

Please sign in to comment.