Skip to content

Commit ba2b533

Browse files
authored
Unfortunately, we have to enable unsafe-inline if we are using Paypal (#4189)
1 parent b7948a9 commit ba2b533

2 files changed

Lines changed: 16 additions & 5 deletions

File tree

config/secure-headers.php

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,11 @@
545545
'connect-src' => [
546546
'self' => true,
547547
'allow' => array_merge(
548-
['https://lycheeorg.dev/update.json'],
548+
[
549+
'https://lycheeorg.dev/update.json',
550+
'https://www.sandbox.paypal.com',
551+
'https://www.paypal.com',
552+
],
549553
explode(',', (string) env('SECURITY_HEADER_CSP_CONNECT_SRC', ''))
550554
),
551555
],
@@ -593,6 +597,7 @@
593597
'https://a.osm.rrze.fau.de/osmhd/',
594598
'https://b.osm.rrze.fau.de/osmhd/',
595599
'https://c.osm.rrze.fau.de/osmhd/',
600+
'https://www.paypalobjects.com',
596601
'data:', // required by openstreetmap
597602
'blob:', // required for "live" photos
598603
],
@@ -701,7 +706,12 @@
701706
'report-sample' => true,
702707

703708
'allow' => array_merge(
704-
['https://www.dropbox.com/static/api/1/dropins.js', 'https://js.mollie.com', 'https://js.stripe.com'],
709+
[
710+
'https://www.dropbox.com/static/api/1/dropins.js',
711+
'https://js.mollie.com',
712+
'https://js.stripe.com',
713+
'https://www.paypal.com/sdk/js',
714+
],
705715
explode(',', (string) env('SECURITY_HEADER_SCRIPT_SRC_ALLOW', ''))
706716
),
707717

@@ -711,7 +721,8 @@
711721
],
712722

713723
/* followings are only work for `script` and `style` related directives */
714-
'unsafe-inline' => false,
724+
// We need this one for PayPal SDK sadly.
725+
'unsafe-inline' => env('PAYPAL_CLIENT_ID', '') !== '',
715726

716727
'unsafe-eval' => false,
717728

@@ -725,7 +736,7 @@
725736

726737
// Those should be removed if we drop v4 legacy support completely.
727738
'hashes' => [
728-
'sha256' => [
739+
'sha256' => env('PAYPAL_CLIENT_ID', '') !== '' ? [] : [
729740
// 'sha256-hash-value-with-base64-encode',
730741

731742
// lychee.startDrag(event)

resources/js/components/webshop/OrderSummary.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div
3-
class="flex flex-col max-h-[75vh] p-8 bg-surface-50 dark:bg-surface-950/25 rounded border border-surface-200 dark:border-surface-700 min-h-[400px]"
3+
class="flex flex-col max-h-[75vh] p-8 bg-surface-50 dark:bg-surface-950/25 rounded border border-surface-200 dark:border-surface-700 min-h-100"
44
v-if="order"
55
>
66
<div class="text-lg font-bold text-center mb-12">{{ $t("webshop.orderSummary.title") }}</div>

0 commit comments

Comments
 (0)