Skip to content

Commit

Permalink
Revert "Update esp-controller.js (#257)" (#258)
Browse files Browse the repository at this point in the history
This reverts commit ce8c55f.
  • Loading branch information
qiyundai authored Oct 16, 2024
1 parent ce8c55f commit 0dfff85
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions ecc/scripts/esp-controller.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getECCEnv, getSecret } from './utils.js';
import { getECCEnv } from './utils.js';

export const getCaasTags = (() => {
let cache;
Expand Down Expand Up @@ -65,7 +65,6 @@ function waitForAdobeIMS() {
export async function constructRequestOptions(method, body = null) {
await waitForAdobeIMS();

const clientIdentity = await getSecret(`${getECCEnv()}-client-identity`);
const headers = new Headers();
const sp = new URLSearchParams(window.location.search);
const devToken = sp.get('devToken');
Expand All @@ -76,7 +75,6 @@ export async function constructRequestOptions(method, body = null) {
headers.append('Authorization', `Bearer ${authToken}`);
headers.append('x-api-key', 'acom_event_service');
headers.append('content-type', 'application/json');
headers.append('x-client-identity', clientIdentity);

const options = {
method,
Expand All @@ -91,7 +89,6 @@ export async function constructRequestOptions(method, body = null) {
export async function uploadImage(file, configs, tracker, imageId = null) {
await waitForAdobeIMS();

const clientIdentity = await getSecret(`${getECCEnv()}-client-identity`);
const { host } = getAPIConfig().esp[getECCEnv()];
const sp = new URLSearchParams(window.location.search);
const devToken = sp.get('devToken');
Expand All @@ -109,7 +106,6 @@ export async function uploadImage(file, configs, tracker, imageId = null) {
xhr.setRequestHeader('x-image-kind', configs.type);
xhr.setRequestHeader('x-api-key', 'acom_event_service');
xhr.setRequestHeader('Authorization', `Bearer ${authToken}`);
xhr.setRequestHeader('x-client-identity', clientIdentity);

if (tracker) {
xhr.upload.onprogress = (event) => {
Expand Down

0 comments on commit 0dfff85

Please sign in to comment.