You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by GitBox <gi...@apache.org> on 2022/12/11 23:51:51 UTC

[GitHub] [logging-log4j2] rgoers commented on a diff in pull request #1164: Check urlConnection for being instance of JarURLConnection instead of relying on protocol name

rgoers commented on code in PR #1164:
URL: https://github.com/apache/logging-log4j2/pull/1164#discussion_r1044551781


##########
log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationSource.java:
##########
@@ -367,7 +357,7 @@ private static ConfigurationSource getConfigurationSource(URL url) {
             try {
                 if (file != null) {
                     return new ConfigurationSource(urlConnection.getInputStream(), FileUtils.fileFromUri(url.toURI()));
-                } else if (JAR.equals(url.getProtocol())) {
+                } else if (urlConnection instanceof JarURLConnection) {

Review Comment:
   1. Why is it necessary to check the class instead of the protocol?
   2. If we add this check why wouldn't we still check the protocol also?



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org