? ? Success

User tests: Successful: Unsuccessful:

avatar zero-24
zero-24
17 Oct 2020

Pull Request for Issue #30962 cc @PhilETaylor

Summary of Changes

Make sure we do not add one header twice but we support to set a different header per client.

Testing Instructions

Setup Plugins -> System - HTTP Headers as this screenshot:

Screenshot 2020-10-07 at 01 04 35

Actual result BEFORE applying this Pull Request

Content-Security-Policy: TWO

Expected result AFTER applying this Pull Request

Content-Security-Policy: ONE

Documentation Changes Required

None

@PhilETaylor I'm not sure whether we should block the save as it could be valid to configure two headers with the same value. e.g. one for the backend and one for the frontend. With this change here we make sure only the first configured per site (or for both) is choosen. I'm not sure how to cleanly validate the subform at that point other than hooking into the onExtensionBeforeSave Event but than this pugin would be triggered on all extension saves does not sound that optimal to me?

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
4.00

avatar zero-24 zero-24 - open - 17 Oct 2020
avatar zero-24 zero-24 - change - 17 Oct 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 17 Oct 2020
Category Front End Plugins
avatar adj9 adj9 - test_item - 17 Oct 2020 - Tested successfully
avatar adj9
adj9 - comment - 17 Oct 2020

I have tested this item successfully on a004fa3

done :)


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/31128.

avatar Giuse69
Giuse69 - comment - 17 Oct 2020

hi, the PR works but why not having a javascript check to warn the user that the same header with the same client is already set when fill the second one? There might more even more effective solutions (like to disable options when already set) but probably not worth the effort.
I think it's useful to at least inform the user that what he has set (multiple values for same header/client) is not what he will get (correctly with this patch but we need to inform the user of the "mistake" if not prevent)

avatar zero-24
zero-24 - comment - 17 Oct 2020

the PR works but why not having a javascript check to warn the user that the same header with the same client is already set when fill the second one?

hmm I get the point but I'm no JS expert do you know how to implement such check in the subform? The other way around could be a validation rule I guess.

avatar ceford ceford - test_item - 18 Oct 2020 - Tested successfully
avatar ceford
ceford - comment - 18 Oct 2020

I have tested this item successfully on a004fa3

It is not so obvious that you look for the result in the headers sent. I was expecting the form to changes! Anyway, I used my browser HTTP Header Live tool and could see the the change from TWO to ONE as described.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/31128.

avatar Giuse69
Giuse69 - comment - 18 Oct 2020

hmm I get the point but I'm no JS expert do you know how to implement such check in the subform? The other way around could be a validation rule I guess.

yes, maybe better validate server-side the configuration of the plugin when saving and not accepting the save operation when parameters, also displaying an error message

avatar vijaykhollam vijaykhollam - test_item - 7 Nov 2020 - Tested successfully
avatar vijaykhollam
vijaykhollam - comment - 7 Nov 2020

I have tested this item successfully on 376a8cb


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/31128.

avatar tushar33 tushar33 - test_item - 7 Nov 2020 - Tested successfully
avatar tushar33
tushar33 - comment - 7 Nov 2020

I have tested this item successfully on 376a8cb


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/31128.

avatar richard67 richard67 - change - 8 Nov 2020
Status Pending Ready to Commit
avatar richard67
richard67 - comment - 8 Nov 2020

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/31128.

avatar richard67
richard67 - comment - 8 Nov 2020

There is a strange error shown in drone for javascript-cs, but that's not related to this PR.

avatar richard67 richard67 - change - 14 Nov 2020
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2020-11-14 13:15:31
Closed_By richard67
Labels Added: ?
avatar richard67 richard67 - close - 14 Nov 2020
avatar richard67 richard67 - merge - 14 Nov 2020
avatar richard67
richard67 - comment - 14 Nov 2020

Thanks!

Add a Comment

Login with GitHub to post a comment