apache / apache/logging-log4j2

Uniform handling of `URLConnection`

Open
#3,794 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
3.6k
Forks
1.7k
Avg merge
21h 30m
Merged PRs (30d)
27

Description

The two versions of the `UrlConnectionFactory.createConnection` method currently handle URLs differently, leading to inconsistencies:

1. **Protocol Enforcement**:

* The four-parameter version enforces the [`log4j2.configurationAllowedProtocols`](https://logging.apache.org/log4j/2.x/manual/systemproperties.html#log4j2.configurationAllowedProtocols) for all protocols.
* The one-parameter version enforces it only for `http` and `https`.

2. **Caching Behavior for the `jar` Protocol**:

* The four-parameter version disables caching for the `jar` protocol **unconditionally**, regardless of the `URLConnection` used.
* The one-parameter version only disables caching for `JarURLConnection` and its subclasses.
* This discrepancy is related to the issue reported in [LOG4J2-3663](https://issues.apache.org/jira/browse/LOG4J2-3663).

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the two UrlConnectionFactory.createConnection overloads and compare their protocol enforcement and jar caching paths. Review LOG4J2-3663 for context; done means both overloads apply the same allowed-protocol and jar-caching behavior, with relevant behavior verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.