andruhon commented on a change in pull request #376: WICKET-6682 add CSP nonce support: DecoratingHeaderResponse approach URL: https://github.com/apache/wicket/pull/376#discussion_r303403279
########## File path: wicket-util/src/main/java/org/apache/wicket/util/value/HeaderItemAttribute.java ########## @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.util.value; + +import org.apache.wicket.util.lang.Args; + +/** + * Some common header item attributes. + * This is not a complete list of all possible attributes. + */ +public enum HeaderItemAttribute implements IAttributeMapKey Review comment: Well, yes, moving all these values into appropriate classes would make the code a lot simpler. Is it something you're looking for: in JavaScriptUtils ``` public static final String ATTR_ID = "src"; public static final String ATTR_TYPE = "type"; public static final String ATTR_SCRIPT_SRC = "src"; public static final String ATTR_SCRIPT_DEFER = "defer"; public static final String ATTR_SCRIPT_ASYNC = "async"; public static final String ATTR_SCRIPT_NOMODULE = "nomodule"; public static final String ATTR_SCRIPT_REFERRERPOLICY = "referrerpolicy"; public static final String ATTR_NONCE = "nonce"; public static final String ATTR_SRI_INTEGRITY = "integrity"; public static final String ATTR_SRI_CROSSORIGIN = "crossorigin"; ``` And similar set in CSSUtils ``` public static final String ATTR_ID = "src"; public static final String ATTR_LINK_HREF = "href"; public static final String ATTR_LINK_MEDIA = "media"; public static final String ATTR_LINK_REL = "rel"; public static final String ATTR_SRI_INTEGRITY = "integrity"; public static final String ATTR_SRI_CROSSORIGIN = "crossorigin"; ``` ? ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
