Skip to content

Fix: Hapus keyword duplikat pada directive object-src di pengaturan Content Security Policy (CSP)#1578

Merged
affandii06 merged 3 commits into
rilis-devfrom
dev-1577
Jun 17, 2026
Merged

Fix: Hapus keyword duplikat pada directive object-src di pengaturan Content Security Policy (CSP)#1578
affandii06 merged 3 commits into
rilis-devfrom
dev-1577

Conversation

@habibie11

Copy link
Copy Markdown
Contributor

issue #1577

Deskripsi PR

PR ini memperbaiki issue pada console browser di environment production di mana terdapat error syntax pada header Content Security Policy (CSP):
The Content-Security-Policy directive 'object-src' contains the keyword 'none' alongside with other source expressions.

Sebelumnya, pada file middleware SecurityHeaders.php, directive di-set menjadi object-src 'none' ".$localDomain.". Sesuai standar spesifikasi web, jika keyword 'none' digunakan, ia harus berdiri sendiri dan tidak boleh digabungkan dengan source expression lainnya (seperti $localDomain). Penggabungan ini membuat browser mengabaikan aturan tersebut dan memunculkan pesan error.

Perubahan yang dilakukan:

  • Menghapus variabel ".$localDomain." dari directive object-src di app/Http/Middleware/SecurityHeaders.php.
  • Directive object-src sekarang murni menggunakan nilai 'none' (yang merupakan best practice keamanan untuk memblokir embed/object eksternal seperti Flash atau Java Applets).

Dampak Perubahan:

  • Menghilangkan pesan error merah CSP di console browser.
  • Memastikan aturan keamanan object-src benar-benar dihormati oleh browser.
  • Tidak ada test yang terdampak/perlu diubah karena pengecekan spesifik header CSP belum ada di test suite.

Cara Pengujian (Testing Instructions):

  1. Pull branch ini.
  2. Buka aplikasi di browser.
  3. Buka Developer Tools -> Console.
  4. Pastikan tidak ada lagi error yang menyebutkan directive 'object-src' contains the keyword 'none'.

@habibie11 habibie11 requested a review from affandii06 June 9, 2026 03:09
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

🔄 AI PR Review sedang antri di server...

Proses review akan segera dimulai di background — hasil akan muncul sebagai komentar setelah selesai.
Powered by CrewAI · PR #1578

@affandii06 affandii06 merged commit f252325 into rilis-dev Jun 17, 2026
@affandii06 affandii06 deleted the dev-1577 branch June 17, 2026 09:10
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