Skip to content

Conversation

@DemonStore
Copy link
Contributor

No description provided.

Copy link
Owner

@frux frux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Привет! Спасибо за PR. Подскажи, для какого кейса нужна поддержка Boolean?

@DemonStore
Copy link
Contributor Author

Жесть, вот это тесен мир, привет! :) Только сейчас увидел автора.
Вот такое хочу поддержать:

getCSP({
    directives: {
        'script-src': [
            // выкидывать какую-то часть по флагу
            someFlag && SELF,
            // ну и просто вырезать пустые значения
            '',
            INLINE,
        ],
    },
    reportUri: 'https://cspreport.com/send'
});

@frux
Copy link
Owner

frux commented Sep 26, 2025

Жесть, вот это тесен мир, привет! :) Только сейчас увидел автора.
Вот такое хочу поддержать:

getCSP({
    directives: {
        'script-src': [
            // выкидывать какую-то часть по флагу
            someFlag && SELF,
            // ну и просто вырезать пустые значения
            '',
            INLINE,
        ],
    },
    reportUri: 'https://cspreport.com/send'
});

Да, тесен :)

Тогда давай строже напишем тип, чтобы туда true не мог попасть.

string | false

@DemonStore
Copy link
Contributor Author

Отличная идея, обновил

@DemonStore DemonStore requested a review from frux October 7, 2025 07:39
@frux frux merged commit 8e37cd1 into frux:master Oct 8, 2025
@frux
Copy link
Owner

frux commented Oct 8, 2025

Спасибо за PR! Выпустил в версии 6.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants