trezy / next-safe

https://trezy.gitbook.io/next-safe/
BSD 3-Clause "New" or "Revised" License
174 stars 20 forks source link

Fixing makeHeaderObj checking wrong param for false #38

Closed johanhermansson closed 1 year ago

johanhermansson commented 2 years ago

Value should be checked for false. This fixes frameOptions: false not working

ivajo26 commented 2 years ago

I need this change 😃

johanhermansson commented 2 years ago

I need this change 😃

@ivajo26 You could bypass the problem by intermediate storing the nextSafe function results in a variable and filter out the X-Frame-Options from the array.

const headers = nextSafe();

module.exports = {
    async headers() {
        return [
            source: '/:path*',
            headers: headers.filter(({ key }) => key !== 'X-Frame-Options')
        ];
    }
};
github-actions[bot] commented 1 year ago

:tada: This PR is included in version 3.3.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: