style(server): format skin CSS policy

This commit is contained in:
Evan Hu committed 2026-09-07 13:32:09 +09:00
1 parent 818069f9c3
commit 8972593b3e
2 files changed
+4 -7

No files matched your search

+2 -3
View File
@@ -214,9 +214,8 @@ bool IsRemoteImport(const std::wstring &rule)
if (cursor >= rule.size() || rule[cursor] != L'(')
return true;
cursor = SkipCssTrivia(rule, cursor + 1);
const wchar_t quote = cursor < rule.size() && (rule[cursor] == L'\'' || rule[cursor] == L'"')
? rule[cursor++]
: 0;
const wchar_t quote =
cursor < rule.size() && (rule[cursor] == L'\'' || rule[cursor] == L'"') ? rule[cursor++] : 0;
const size_t start = cursor;
while (cursor < rule.size())
{
+2 -4
View File
@@ -87,10 +87,8 @@ TEST_CASE(skin_css_import_stripping_only_matches_a_real_at_rule)
std::wstring(L"@charset \"utf-8\";.b{}"));
REQUIRE_EQ(StripRemoteImports(L"/* skin comment */ @import \"https://attacker.example/x\";.b{}"),
std::wstring(L"/* skin comment */ .b{}"));
REQUIRE_EQ(StripRemoteImports(L"@import \"https:\\/\\/attacker.example/x\";.b{}"),
std::wstring(L".b{}"));
REQUIRE_EQ(StripRemoteImports(L"@import \"https\\3a \\2f\\2fattacker.example/x\";.b{}"),
std::wstring(L".b{}"));
REQUIRE_EQ(StripRemoteImports(L"@import \"https:\\/\\/attacker.example/x\";.b{}"), std::wstring(L".b{}"));
REQUIRE_EQ(StripRemoteImports(L"@import \"https\\3a \\2f\\2fattacker.example/x\";.b{}"), std::wstring(L".b{}"));
}
TEST_CASE(skin_css_local_imports_and_plain_stylesheets_are_untouched)