Content-Security-Policy problem
Posted by: papijo (---.w2-10.abo.wanadoo.fr)
Date: January 08, 2024 04:39PM

Hello and Happy New Year 2024 to all forum members!
I've come across a tricky problem on my WampServer install when trying to use an H5P content, [h5p.org]. The problem is reported here: [github.com]
It seems that somewhere in the WampServer the Content-Security-Policy settings block access to the clipboard in all browsers.
Any hints?
Joseph aka papi Jo

Options: ReplyQuote
Re: Content-Security-Policy problem
Posted by: RiggsFolly (Moderator)
Date: January 09, 2024 04:48PM

This is a browser/javascript message and nothing to do with WAMPServer per se.

Remember, WAMPServer is the wrapper that allows easy install of Apache,PHP.mysql. etc etc.

Content-Security-Policy is managed by either a script or Apache, all of which are now YOURS to COMMAND.

By default there are no Content-Security-Policy directives in Apache, unless you added some.


So installing WAMPServer only allows you the ability to learn all these things in a safe environment, it does not come with the knowledge you need to use these tools. But the good news is the internet is full of resources where you can teach yourself all the required knowledge.

Maybe you can start with a A good read up on Content Security Policy WHat is is and how to get it to do what you want it to.

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: Content-Security-Policy problem
Posted by: papijo (---.w2-10.abo.wanadoo.fr)
Date: January 09, 2024 06:24PM

@RiggsFolly,
Thanks for responding. Just to make sure I installed XAMPP on my local machine... and I no longer have the problem I reported with the Content-Security-Policy settings blocking access to the clipboard in my H5P content.
I have also tried with the Lumi software [app.lumi.education], which creates its own local server. No problem.
I can only conclude that there is something in WAMPServer which causes the problem, but where is that setting?

Options: ReplyQuote
Re: Content-Security-Policy problem
Posted by: Otomatic (Moderator)
Date: January 10, 2024 09:02AM

Hi,

With Wampserver, by default, localhost and subsequently defined VirtualHost only allow local access via Require local. Perhaps this is where you need to look.

From what I've read on CSP, these directives come from the headers of Web sites and have little to do with the server.

On an Apache server, you need to define the Content Security Policy in your site's .htaccess file or in VirtualHost.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Content-Security-Policy problem
Posted by: papijo (---.w2-10.abo.wanadoo.fr)
Date: January 11, 2024 11:42PM

Thanks for those answers. However I am still stuck and don't understand why I should experience this problem with WAMPServer but no problem with XAMPP ?

Options: ReplyQuote
Re: Content-Security-Policy problem
Posted by: Otomatic (Moderator)
Date: January 12, 2024 09:06AM

Compare Apache configurations and modules, and VirtualHost differences between Wampserver and Xampp.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote


Sorry, only registered users may post in this forum.