Skip to content

Commit

Permalink
fix: 503 error due to action served from 'adobe-static.net' (#231)
Browse files Browse the repository at this point in the history
* fix: Get around the timeout of 30 secs when action is served from 'adobe-static.net'

* chore: Update Copyright year
  • Loading branch information
askayastha22 committed Mar 20, 2024
1 parent 941abe5 commit 44cdd1c
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "aem-genai-assistant",
"version": "2.0.3",
"version": "2.0.4",
"private": true,
"scripts": {
"prepare": "husky install",
Expand Down
15 changes: 15 additions & 0 deletions web-src/src/helpers/UrlHelper.js
@@ -0,0 +1,15 @@
/*
* Copyright 2024 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/

export function replaceRuntimeDomainInUrl(url) {
return url.replace('adobeio-static.net', 'adobeioruntime.net');
}
5 changes: 3 additions & 2 deletions web-src/src/services/FirefallService.js
Expand Up @@ -10,6 +10,7 @@
* governing permissions and limitations under the License.
*/
import { wretch } from '../helpers/NetworkHelper.js';
import { replaceRuntimeDomainInUrl } from '../helpers/UrlHelper.js';

export class FirefallService {
constructor({
Expand All @@ -18,8 +19,8 @@ export class FirefallService {
imsOrg,
accessToken,
}) {
this.completeEndpoint = completeEndpoint;
this.feedbackEndpoint = feedbackEndpoint;
this.completeEndpoint = replaceRuntimeDomainInUrl(completeEndpoint);
this.feedbackEndpoint = replaceRuntimeDomainInUrl(feedbackEndpoint);
this.imsOrg = imsOrg;
this.accessToken = accessToken;

Expand Down

0 comments on commit 44cdd1c

Please sign in to comment.