Skip to content

Commit

Permalink
localized component URI encoding to 'document' using general encodeURI
Browse files Browse the repository at this point in the history
for JobCook.
  • Loading branch information
EMaslowskiQ committed Nov 29, 2023
1 parent 54d6350 commit 3fea412
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion client/src/utils/repository.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ export function getVoyagerStoryUrl(serverEndPoint: string | undefined, idSystemO

const mode: string = getModeForVoyager(eMode);
const root: string = getRootSceneDownloadUrlForVoyager(serverEndPoint, idSystemObject, path, eMode);
const uri: string = `/repository/voyager/${idSystemObject}?mode=${mode}&root=${root}&document=${document}`;
const uri: string = `/repository/voyager/${idSystemObject}?mode=${mode}&root=${root}&document=${encodeURIComponent(document)}`;
// console.log(`>>> getVoyagerStoryURL (document: ${document} | root: ${root} | uri: ${uri} | path: ${path})`);
return uri;
}
Expand Down
8 changes: 4 additions & 4 deletions server/job/impl/Cook/JobCook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ export abstract class JobCook<T> extends JobPackrat {
while (true) {
try {
LOG.info(`JobCook [${this.name()}] creating job: ${requestUrl} body ${JSON.stringify(jobCookPostBody, H.Helpers.saferStringify)}`, LOG.LS.eJOB);
const axiosResponse: AxiosResponse<any> | null = await axios.post(encodeURIComponent(requestUrl), jobCookPostBody);
const axiosResponse: AxiosResponse<any> | null = await axios.post(encodeURI(requestUrl), jobCookPostBody);

if (axiosResponse?.status === 201)
break; // success, continue
Expand Down Expand Up @@ -302,7 +302,7 @@ export abstract class JobCook<T> extends JobPackrat {
while (true) {
try {
LOG.info(`JobCook [${this.name()}] running job: ${requestUrl}`, LOG.LS.eJOB);
const axiosResponse = await axios.patch(encodeURIComponent(requestUrl));
const axiosResponse = await axios.patch(encodeURI(requestUrl));
if (axiosResponse.status === 202)
break; // success, continue
res = { success: false, error: `JobCook [${this.name()}] patch ${requestUrl} failed: ${JSON.stringify(axiosResponse)}` };
Expand Down Expand Up @@ -338,7 +338,7 @@ export abstract class JobCook<T> extends JobPackrat {
LOG.info(`JobCook [${this.name()}] cancelling job: ${requestUrl}`, LOG.LS.eJOB);
while (true) {
try {
const axiosResponse = await axios.patch(encodeURIComponent(requestUrl));
const axiosResponse = await axios.patch(encodeURI(requestUrl));
if (axiosResponse.status !== 200)
res = { success: false, error: `JobCook [${this.name()}] patch ${requestUrl} failed: ${JSON.stringify(axiosResponse)}` };
} catch (error) {
Expand All @@ -365,7 +365,7 @@ export abstract class JobCook<T> extends JobPackrat {
// Get job report via GET to /clients/<CLIENTID>/jobs/<JOBID>/report
const requestUrl: string = this.CookServerURL() + `clients/${this._configuration.clientId}/jobs/${this._configuration.jobId}/report`;
try {
const axiosResponse = await axios.get(encodeURIComponent(requestUrl));
const axiosResponse = await axios.get(encodeURI(requestUrl));
if (axiosResponse.status !== 200) {
// only log errors after first attempt, as job creation may not be complete on Cook server
const error: string = JSON.stringify(axiosResponse);
Expand Down

0 comments on commit 3fea412

Please sign in to comment.