Skip to content

Commit

Permalink
Fix no bootstrap when @endpoint is used
Browse files Browse the repository at this point in the history
  • Loading branch information
Giwi committed Aug 24, 2023
1 parent 64e0caf commit f6bfb93
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -607,13 +607,13 @@ FLOWS
this.loading = true;
// parse comments to look for inline url or preview modifiers
const specialHeaders = WarpScriptParser.extractSpecialComments(code);
const previewType = specialHeaders.displayPreviewOpt || 'none';
const previewType = specialHeaders.displayPreviewOpt ?? 'none';
if (previewType === 'I') {
this.selectedResultTab = 2; // select image tab.
} else if (this.selectedResultTab === 2) {
this.selectedResultTab = 0; // on next execution, select results tab.
}
const executionUrl = specialHeaders.endpoint || this.url;
const executionUrl = specialHeaders.endpoint ?? this.url;
this.LOG.debug(['execute'], 'specialHeaders', this.innerConfig.addLocalHeader);
// Get Warp10 version
// @ts-ignore
Expand All @@ -627,7 +627,7 @@ FLOWS
if (!!session) {
headers['X-Warp10-WarpScriptSession'] = session;
}
this.request = this.http.post<HttpResponse<string>>(executionUrl, (bootstrap ? bootstrap + ' ' : '') + code, {
this.request = this.http.post<HttpResponse<string>>(executionUrl, (!specialHeaders.endpoint && bootstrap ? bootstrap + ' ' : '') + code, {
observe: 'response',
// @ts-ignore
responseType: 'text',
Expand All @@ -637,7 +637,7 @@ FLOWS
.subscribe((res: HttpResponse<string>) => {
if (!!res) {
this.LOG.debug(['execute'], 'response', res.body);
this.warpViewEditorWarpscriptResult.emit(res.body || (res as any));
this.warpViewEditorWarpscriptResult.emit(res.body ?? (res as any));
BubblingEvents.emitBubblingEvent(this.el, 'warpViewEditorWarpscriptResult', res.body || (res as any));
if (!!res.headers) {
this.sendStatus({
Expand Down

0 comments on commit f6bfb93

Please sign in to comment.