Skip to content
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
10 changes: 9 additions & 1 deletion nosecone/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,7 @@ export function createXssProtection() {
* @returns
* `Headers` with the configured security headers.
*/
export default function nosecone(options?: Options | undefined) {
export function nosecone(options?: Options | undefined) {
let contentSecurityPolicy =
options?.contentSecurityPolicy ?? defaults.contentSecurityPolicy;
let crossOriginEmbedderPolicy =
Expand Down Expand Up @@ -1080,6 +1080,14 @@ export default function nosecone(options?: Options | undefined) {
return headers;
}

/**
* Create security headers.
*
* @deprecated
* Use the named export `nosecone` instead.
*/
export default nosecone;

/**
* Augment some Nosecone configuration with the values necessary for using the
* Vercel Toolbar.
Expand Down
2 changes: 1 addition & 1 deletion nosecone/test/nosecone.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ test("nosecone", async function (t) {
"createReferrerPolicy",
"createStrictTransportSecurity",
"createXssProtection",
// TODO(@wooorm-arcjet): use named exports.
"default",
// TODO(@wooorm-arcjet): use a clearer name: defaults for what, function to generate them?
"defaults",
"nosecone",
"withVercelToolbar",
]);
});
Expand Down