Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ArminaAiren committed Jan 8, 2024
1 parent 25c4ea0 commit ff07f23
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 37 deletions.
58 changes: 29 additions & 29 deletions nextjs/csp/policies/ad.ts
Original file line number Diff line number Diff line change
@@ -1,58 +1,58 @@
import Base64 from "crypto-js/enc-base64";
import sha256 from "crypto-js/sha256";
import type CspDev from "csp-dev";
import Base64 from 'crypto-js/enc-base64';
import sha256 from 'crypto-js/sha256';
import type CspDev from 'csp-dev';

import { connectAdbutler, placeAd } from "ui/shared/ad/adbutlerScript";
import { connectAdbutler, placeAd } from 'ui/shared/ad/adbutlerScript';

export function ad(): CspDev.DirectiveDescriptor {
return {
"connect-src": [
'connect-src': [
// coinzilla
"coinzilla.com",
"*.coinzilla.com",
"https://request-global.czilladx.com",
'coinzilla.com',
'*.coinzilla.com',
'https://request-global.czilladx.com',

// slise
"*.slise.xyz",
'*.slise.xyz',

// hype
"api.hypelab-staging.com",
"api.hypelab.com",
"d1q98dzwj6s2rb.cloudfront.net",
"*.ixncdn.com",
"api.jxncdn.com",
'api.hypelab-staging.com',
'api.hypelab.com',
'd1q98dzwj6s2rb.cloudfront.net',
'*.ixncdn.com',
'api.jxncdn.com',
],
"frame-src": [
'frame-src': [
// coinzilla
"https://request-global.czilladx.com",
'https://request-global.czilladx.com',
],
"script-src": [
'script-src': [
// coinzilla
"coinzillatag.com",
'coinzillatag.com',

// adbutler
"servedbyadbutler.com",
`'sha256-${Base64.stringify(sha256(connectAdbutler))}'`,
`'sha256-${Base64.stringify(sha256(placeAd ?? ""))}'`,
'servedbyadbutler.com',
`'sha256-${ Base64.stringify(sha256(connectAdbutler)) }'`,
`'sha256-${ Base64.stringify(sha256(placeAd ?? '')) }'`,

// slise
"*.slise.xyz",
'*.slise.xyz',

"cdn.jsdelivr.net",
'cdn.jsdelivr.net',

// hype
"'unsafe-eval'",
'\'unsafe-eval\'',
],
"img-src": [
'img-src': [
// coinzilla
"cdn.coinzilla.io",
'cdn.coinzilla.io',

// adbutler
"servedbyadbutler.com",
'servedbyadbutler.com',
],
"font-src": [
'font-src': [
// coinzilla
"https://request-global.czilladx.com",
'https://request-global.czilladx.com',
],
};
}
11 changes: 3 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10961,14 +10961,9 @@ husky@^8.0.0:
resolved "https://registry.yarnpkg.com/husky/-/husky-8.0.1.tgz#511cb3e57de3e3190514ae49ed50f6bc3f50b3e9"
integrity sha512-xs7/chUH/CKdOCs7Zy0Aev9e/dKOMZf3K1Az1nar3tzlv0jfqnYtu235bstsWTmXOR0EfINrPa97yy4Lz6RiKw==

hypelab-react@./hypelab-react-0.5.1.tgz:
version "0.5.1"
resolved "./hypelab-react-0.5.1.tgz#8a4e108934677d9f344cad9d4d7aafbfb50bb2ac"

hypelab-react@^0.5.0:
version "0.5.0"
resolved "https://registry.yarnpkg.com/hypelab-react/-/hypelab-react-0.5.0.tgz#27fd56016f73cdac01fb3d0aac716842170ec383"
integrity sha512-5htdSf60gcn9MGUaffLjljd1GtSAFpIbHMo4Os9NXCAdID73u1R9M2ON44Wtf7+DAwfB2JfJoDAb395p9eQ9wg==
hypelab-react@./hypelab-react-0.5.2.tgz:
version "0.5.2"
resolved "./hypelab-react-0.5.2.tgz#64bf72c27b0fa275c003171edaae37df9361cb56"

[email protected], [email protected]:
version "0.6.3"
Expand Down

0 comments on commit ff07f23

Please sign in to comment.