Skip to content

Commit 21a3652

Browse files
committed
correction to use application/yaml and not text/yaml
1 parent 502cf2e commit 21a3652

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

dist/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25788,7 +25788,7 @@ async function validateFile(filePath, options) {
2578825788
};
2578925789
body = JSON.stringify(requestPayload);
2579025790
} else {
25791-
contentType = 'text/yaml';
25791+
contentType = 'application/yaml';
2579225792
body = buildYamlPayload(content, changesetVariables);
2579325793
}
2579425794

@@ -25885,7 +25885,7 @@ async function executeFile(filePath, options) {
2588525885
};
2588625886
body = JSON.stringify(requestPayload);
2588725887
} else {
25888-
contentType = 'text/yaml';
25888+
contentType = 'application/yaml';
2588925889
body = buildYamlPayload(content, changesetVariables);
2589025890
}
2589125891

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ async function validateFile(filePath, options) {
140140
};
141141
body = JSON.stringify(requestPayload);
142142
} else {
143-
contentType = 'text/yaml';
143+
contentType = 'application/yaml';
144144
body = buildYamlPayload(content, changesetVariables);
145145
}
146146

@@ -237,7 +237,7 @@ async function executeFile(filePath, options) {
237237
};
238238
body = JSON.stringify(requestPayload);
239239
} else {
240-
contentType = 'text/yaml';
240+
contentType = 'application/yaml';
241241
body = buildYamlPayload(content, changesetVariables);
242242
}
243243

src/index.test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -569,8 +569,8 @@ describe('run — changeset file resolution', () => {
569569
await promise;
570570

571571
const callArgs = mockFetch.mock.calls[0]; // First call is execute
572-
// YAML files are sent as text/yaml with buildYamlPayload format
573-
expect(callArgs[1].headers['Content-Type']).toBe('text/yaml');
572+
// YAML files are sent as application/yaml with buildYamlPayload format
573+
expect(callArgs[1].headers['Content-Type']).toBe('application/yaml');
574574
expect(callArgs[1].body).toContain('changeset: |');
575575
expect(callArgs[1].body).toContain('name: Test Queue');
576576
expect(mockCore.info).toHaveBeenCalledWith(expect.stringContaining('Read changeset from file'));
@@ -719,7 +719,7 @@ describe('run — execute without validation', () => {
719719
method: 'POST',
720720
headers: {
721721
'Authorization': 'Api-Key key',
722-
'Content-Type': 'text/yaml',
722+
'Content-Type': 'application/yaml',
723723
},
724724
})
725725
);
@@ -1375,7 +1375,7 @@ describe('run — changeset variables', () => {
13751375

13761376
// Verify the first fetch call (execute) has variables in YAML request body
13771377
const callArgs = mockFetch.mock.calls[0];
1378-
expect(callArgs[1].headers['Content-Type']).toBe('text/yaml');
1378+
expect(callArgs[1].headers['Content-Type']).toBe('application/yaml');
13791379
expect(callArgs[1].body).toContain('variables:');
13801380
expect(callArgs[1].body).toContain('DATABASE_PASSWORD: "secret123"');
13811381
expect(callArgs[1].body).toContain('API_TOKEN: "token456"');
@@ -1406,7 +1406,7 @@ describe('run — changeset variables', () => {
14061406
expect(postCalls.length).toBeGreaterThanOrEqual(2); // validate and execute
14071407
postCalls.forEach(call => {
14081408
expect(call[0]).toContain('inprod.io');
1409-
expect(call[1].headers['Content-Type']).toBe('text/yaml');
1409+
expect(call[1].headers['Content-Type']).toBe('application/yaml');
14101410
expect(call[1].body).toContain('changeset: |');
14111411
expect(call[1].body).toContain('variables:');
14121412
expect(call[1].body).toContain('DB_USER: "admin"');
@@ -1525,7 +1525,7 @@ describe('run — changeset variables', () => {
15251525
const postCalls = mockFetch.mock.calls.filter(call => call[1].method === 'POST');
15261526
expect(postCalls.length).toBe(3); // 3 files
15271527
postCalls.forEach(call => {
1528-
expect(call[1].headers['Content-Type']).toBe('text/yaml');
1528+
expect(call[1].headers['Content-Type']).toBe('application/yaml');
15291529
expect(call[1].body).toContain('variables:');
15301530
expect(call[1].body).toContain('DB_PASSWORD: "secret"');
15311531
expect(call[1].body).toContain('API_KEY: "key123"');

0 commit comments

Comments
 (0)