Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix for media types #19

Merged
merged 4 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bruno/Get A Collection.bru
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ tests {

test("Verify response content type", function() {
const contentType = res.getHeader('content-type');
expect(contentType).to.include('application/stix+json');
expect(contentType).to.include('application/taxii+json');
expect(contentType).to.include('version=2.1');
});

Expand Down
2 changes: 1 addition & 1 deletion bruno/Get API Root Information.bru
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ tests {

test("Verify response content type", function() {
const contentType = res.getHeader('content-type');
expect(contentType).to.include('application/stix+json');
expect(contentType).to.include('application/taxii+json');
expect(contentType).to.include('version=2.1');
});

Expand Down
2 changes: 1 addition & 1 deletion bruno/Get An Object.bru
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ tests {

test("Verify response content type", function() {
const contentType = res.getHeader('content-type');
expect(contentType).to.include('application/stix+json');
expect(contentType).to.include('application/taxii+json');
expect(contentType).to.include('version=2.1');
});

Expand Down
2 changes: 1 addition & 1 deletion bruno/Get Collections.bru
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ tests {

test("Verify response content type", function() {
const contentType = res.getHeader('content-type');
expect(contentType).to.include('application/stix+json');
expect(contentType).to.include('application/taxii+json');
expect(contentType).to.include('version=2.1');
});

Expand Down
2 changes: 1 addition & 1 deletion bruno/Get Object Manifests.bru
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ tests {

test("Verify response content type", function() {
const contentType = res.getHeader('content-type');
expect(contentType).to.include('application/stix+json');
expect(contentType).to.include('application/taxii+json');
expect(contentType).to.include('version=2.1');
});

Expand Down
2 changes: 1 addition & 1 deletion bruno/Get Object Versions.bru
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ tests {

test("Verify response content type", function() {
const contentType = res.getHeader('content-type');
expect(contentType).to.include('application/stix+json');
expect(contentType).to.include('application/taxii+json');
expect(contentType).to.include('version=2.1');
});

Expand Down
2 changes: 1 addition & 1 deletion bruno/Get Objects.bru
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ tests {

test("Verify response content type", function() {
const contentType = res.getHeader('content-type');
expect(contentType).to.include('application/stix+json');
expect(contentType).to.include('application/taxii+json');
expect(contentType).to.include('version=2.1');
});

Expand Down
2 changes: 1 addition & 1 deletion bruno/Server Discovery.bru
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ tests {

test("Verify response content type", function() {
const contentType = res.getHeader('content-type');
expect(contentType).to.include('application/stix+json');
expect(contentType).to.include('application/taxii+json');
expect(contentType).to.include('version=2.1');
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,8 @@ export class SetResponseMediaType implements NestInterceptor {

const requestedMediaType: MediaTypeObject = req[MEDIA_TYPE_TOKEN];

requestedMediaType._subType = requestedMediaType._subType.replace(
"taxii",
"stix"
);

const contentType = requestedMediaType.toString();

contentType.replace("taxii", "stix");

res.setHeader("Content-Type", contentType);
})
);
Expand Down
Loading