You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by sv...@apache.org on 2019/09/27 12:49:42 UTC

[wicket] 02/02: WICKET-6682 remove meta based on 'http-equiv' too

This is an automated email from the ASF dual-hosted git repository.

svenmeier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/wicket.git

commit 5d99df322d62e3ea8a443d2f90dfac03a708dbb5
Author: Sven Meier <sv...@apache.org>
AuthorDate: Fri Sep 27 14:38:19 2019 +0200

    WICKET-6682 remove meta based on 'http-equiv' too
    
    otherwise CSP metas will pile up
---
 .../main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js b/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
index 70dd69d..dd856cf 100644
--- a/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
+++ b/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
@@ -2003,11 +2003,15 @@
 						var meta = Wicket.Head.createElement("meta"),
 							$meta = jQuery(meta),
 							attrs = jQuery(node).prop("attributes"),
-							name = node.getAttribute("name");
+							name = node.getAttribute("name"),
+							httpEquiv = node.getAttribute("http-equiv");
 
-						if(name) {
+						if (name) {
 							jQuery('meta[name="' + name + '"]').remove();
+						} else if (httpEquiv) {
+							jQuery('meta[http-equiv="' + httpEquiv + '"]').remove();
 						}
+						
 						jQuery.each(attrs, function() {
 							$meta.attr(this.name, this.value);
 						});