Skip to content

Commit

Permalink
fix(airship): resolved minor bugsnag error
Browse files Browse the repository at this point in the history
  • Loading branch information
sandeepdsvs committed Dec 18, 2024
1 parent 227419f commit 998e3a0
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/v0/destinations/airship/transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ const trackResponseBuilder = async (message, { Config }) => {
}

payload.name = name.replace(/\s+/g, '_');
if (payload.value) {
if (payload.value && typeof payload.value === 'string') {
payload.value.replace(/\s+/g, '_');
}
const { appKey, dataCenter, apiKey } = Config;
Expand Down
71 changes: 71 additions & 0 deletions test/integrations/destinations/airship/processor/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1934,6 +1934,77 @@ export const data = [
},
},
},
{
name: 'airship',
description: 'Test 16',
feature: 'processor',
module: 'destination',
version: 'v0',
input: {
request: {
body: [
{
message: {
type: 'track',
messageId: '84e26acc-56a5-4835-8233-591137fca468',
session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22',
originalTimestamp: '2019-10-14T09:03:17.562Z',
anonymousId: '123456',
event: 'Product Clicked',
userId: 'testuserId1',
properties: { value: 55 },
integrations: { All: true },
sentAt: '2019-10-14T09:03:22.563Z',
},
destination: {
Config: {
apiKey: 'dummyApiKey',
appKey: 'ffdf',
appSecret: 'fhf',
dataCenter: false,
},
},
},
],
method: 'POST',
},
},
output: {
response: {
status: 200,
body: [
{
output: {
version: '1',
type: 'REST',
method: 'POST',
endpoint: 'https://go.urbanairship.com/api/custom-events',
headers: {
'Content-Type': 'application/json',
Accept: 'application/vnd.urbanairship+json; version=3',
'X-UA-Appkey': 'ffdf',
Authorization: 'Bearer dummyApiKey',
},
params: {},
body: {
JSON: {
occured: '2019-10-14T09:03:17.562Z',
user: { named_user_id: 'testuserId1' },
body: { name: 'product_clicked', value: 55 },
},
JSON_ARRAY: {},
XML: {},
FORM: {},
},
files: {},
userId: '',
},
statusCode: 200,

Check failure

Code scanning / CodeQL

Hard-coded credentials Critical test

The hard-coded value "Bearer dummyApiKey" is used as
authorization header
.
},
],
},
},
},
{
name: 'airship',
description: 'Test 17',
Expand Down

0 comments on commit 998e3a0

Please sign in to comment.