Skip to content

Commit

Permalink
fix: update supported media types
Browse files Browse the repository at this point in the history
  • Loading branch information
seansica committed Sep 12, 2024
1 parent 1468fee commit 54a9066
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
export enum SupportedMediaTypes {
"application" = "application",
Application = "application",
}

export enum SupportedMediaSubTypes {
"taxii+json" = "taxii+json",
TaxiiJson = "taxii+json",
}

export enum SupportedMediaVersion {
V21 = "2.1",
LATEST = "2.1",
}

export const DEFAULT_CONTENT_TYPE = `${SupportedMediaTypes.Application}/${SupportedMediaSubTypes.TaxiiJson};version=${SupportedMediaVersion.LATEST}` as const;
7 changes: 4 additions & 3 deletions src/taxii/providers/discovery/discovery.service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Injectable } from "@nestjs/common";
import { TaxiiConfigService } from "src/config";
import { DiscoverOptions, DiscoveryDto, ApiRootDto } from "./dto";
import { DEFAULT_CONTENT_TYPE } from "src/common/middleware/content-negotiation/supported-media-types";

@Injectable()
export class DiscoveryService {
Expand All @@ -22,9 +23,9 @@ export class DiscoveryService {
return new ApiRootDto({
title: this.config.API_ROOT_TITLE,
description: this.config.API_ROOT_DESCRIPTION,
version: "application/taxii+json;version=2.1", // ** A value of "application/taxii+json;version=2.1" MUST
// be included in this list to indicate conformance with
// this specification. ** //
versions: [
DEFAULT_CONTENT_TYPE, // ** A value of "application/taxii+json;version=2.1" MUST be included in this list to indicate conformance with this specification. ** //
],
maxContentLength: this.config.MAX_CONTENT_LENGTH,
});
}
Expand Down

0 comments on commit 54a9066

Please sign in to comment.