-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[4.0]Make sure we do not add one header twice but we support to set a different header per client. #31128
Conversation
…erent header per client.
I have tested this item ✅ successfully on a004fa3 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/31128. |
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. |
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. |
I have tested this item ✅ successfully on a004fa3 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/31128. |
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 |
Co-authored-by: Quy <quy@fluxbb.org>
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. |
1 similar comment
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. |
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/31128. |
There is a strange error shown in drone for javascript-cs, but that's not related to this PR. |
Thanks! |
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:
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?