Re: [PR] Fix null stream issue for resource loading based on relative names [tomcat]

2025-02-06 Thread via GitHub


AmshikaH commented on PR #816:
URL: https://github.com/apache/tomcat/pull/816#issuecomment-2640799036

   > The Java documentation for resource names also states:
   > 
   > > The methods in ClassLoader use the given String as the name of the 
resource without applying any absolute/relative transformation (see the methods 
in Class). The name should not have a leading "/".
   > 
   > That doesn't mean the issue isn't going to be fixed in Tomcat. But it does 
mean it looks like CXF has a bug that should be fixed.
   
   Please find the issue on CXF's Jira board here: 
https://issues.apache.org/jira/browse/CXF-9108
   
   I have credited you by linking your GitHub profile and the quoted comment in 
the report. If you have an account in the Jira issue board that you would 
prefer being tagged instead, please do let me know and I can update the issue.
   
   


-- 
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: dev-unsubscr...@tomcat.apache.org

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


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: [PR] Fix null stream issue for resource loading based on relative names [tomcat]

2025-02-06 Thread via GitHub


AmshikaH commented on PR #816:
URL: https://github.com/apache/tomcat/pull/816#issuecomment-2641001780

   > * Tomcat 11 and earlier, skip the `notFoundClassResources` cache if the 
name starts with '/'
   
   I have updated the PR according to this approach. 


-- 
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: dev-unsubscr...@tomcat.apache.org

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


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 69552] Performance regression in MessageBytes.toBytes() when using non-default charset

2025-02-06 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=69552

--- Comment #7 from John Engebretson  ---
Looks like the right move here is to add an extra pointer on MessageBytes and
reuse the utf8 payload.  For example, modify the last part of toBytes() with an
extra branch:

ByteBuffer bb;
if (type == T_CHARS) {
bb = getCharset().encode(CharBuffer.wrap(charC));
/* next lines are new */
} else if (getCharset() == StandardCharsets.UTF_8) {
if (utf8_bytes == null) {
utf8_bytes = StandardCharsets.UTF_8.encode(strValue);
}
bb = utf8_bytes;
} else {
// Must be T_STR
bb = getCharset().encode(strValue);
}

This eliminates the redundant parsing of the message and allocating/populating
of the ByteBuffer... a.k.a. large reduction in object allocation and duplicate
work.

The tradeoff is that it extends the lifetime of the currently-created
ByteBuffers from this method to the lifetime of the MessageBytes instance,
which is typically the duration of the current request.  That seems acceptable
to me.

Also, this optimization is applicable only to applications outputting utf-8. 
Various sources on the web say utf-8 is by far the most common, so we should be
okay; the second-most common is ISO_8859_1 and that is already optimized.  Any
other character set should see net-neutral performance from this change.

Thoughts?

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 69569] SPAM SPAM SPAM SPAM

2025-02-06 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=69569

Chuck Caldarale  changed:

   What|Removed |Added

 Resolution|--- |INVALID
Summary|product from the online |SPAM SPAM SPAM SPAM
   |store.  |
URL|https://elektri4ko.com/ |
 Status|NEW |RESOLVED

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: [PR] Fix null stream issue for resource loading based on relative names [tomcat]

2025-02-06 Thread via GitHub


markt-asf commented on PR #816:
URL: https://github.com/apache/tomcat/pull/816#issuecomment-2640639410

   I think I understand everything that is going on now.
   
   The root cause is that Tomcat accepts name for 
`ClassLoader.getResource(String name)` and friends with a leading '/' whereas 
the JRE provided class loaders do not.
   
   My plan to deal with this is:
   - Tomcat 12 onwards return `null` if the name starts with `/`
   - Tomcat 11 and earlier, skip the `notFoundClassResources` cache if the name 
starts with '/'
   
   Apps that use incorrect resource names may see a small performance 
degradation if they try loading the same resource multiple times using the 
wrong format for a resource name. The fix for that would be for the app to use 
the correct format.


-- 
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: dev-unsubscr...@tomcat.apache.org

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


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



(tomcat) branch 11.0.x updated: clean up org.apache.tomcat.util.http RequestUtil (#818)

2025-02-06 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 11.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/11.0.x by this push:
 new dadb9b09b4 clean up org.apache.tomcat.util.http  RequestUtil (#818)
dadb9b09b4 is described below

commit dadb9b09b4912e8fcca09fd9edb8a33768badaed
Author: 김민종 
AuthorDate: Fri Feb 7 00:52:06 2025 +0900

clean up org.apache.tomcat.util.http  RequestUtil (#818)

Cleanup RequestUtil with test case
---
 java/org/apache/tomcat/util/http/RequestUtil.java | 15 ---
 .../tomcat/util/http/TestRequestUtilSameOrigin.java   | 10 ++
 2 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/java/org/apache/tomcat/util/http/RequestUtil.java 
b/java/org/apache/tomcat/util/http/RequestUtil.java
index fe4d1e639a..d8bbae5c81 100644
--- a/java/org/apache/tomcat/util/http/RequestUtil.java
+++ b/java/org/apache/tomcat/util/http/RequestUtil.java
@@ -123,19 +123,12 @@ public class RequestUtil {
 // Build scheme://host:port from request
 StringBuilder target = new StringBuilder();
 String scheme = request.getScheme();
-if (scheme == null) {
-return false;
-} else {
-scheme = scheme.toLowerCase(Locale.ENGLISH);
-}
-target.append(scheme);
-target.append("://");
-
 String host = request.getServerName();
-if (host == null) {
+if (scheme == null || host == null) {
 return false;
 }
-target.append(host);
+scheme = scheme.toLowerCase(Locale.ENGLISH);
+target.append(scheme).append("://").append(host);
 
 int port = request.getServerPort();
 // Origin may or may not include the (default) port.
@@ -161,7 +154,7 @@ public class RequestUtil {
 
 // Both scheme and host are case-insensitive but the CORS spec states
 // this check should be case-sensitive
-return origin.equals(target.toString());
+return origin.contentEquals(target);
 }
 
 
diff --git a/test/org/apache/tomcat/util/http/TestRequestUtilSameOrigin.java 
b/test/org/apache/tomcat/util/http/TestRequestUtilSameOrigin.java
index e47e7d80d3..40a9bde55a 100644
--- a/test/org/apache/tomcat/util/http/TestRequestUtilSameOrigin.java
+++ b/test/org/apache/tomcat/util/http/TestRequestUtilSameOrigin.java
@@ -42,6 +42,8 @@ public class TestRequestUtilSameOrigin {
 TesterRequest request2 = new TesterRequest("ws", "example.com", 80);
 TesterRequest request3 = new TesterRequest("http", "example.com", 443);
 TesterRequest request4 = new TesterRequest("http", "example.com", 
8080);
+TesterRequest request5 = new TesterRequest(null, "example.com", 80);
+TesterRequest request6 = new TesterRequest("http", null, 8080);
 
 parameterSets.add(new Object[] { request1, "http://example.com";, 
Boolean.TRUE });
 parameterSets.add(new Object[] { request1, "http://example.com:80";, 
Boolean.TRUE });
@@ -59,6 +61,14 @@ public class TestRequestUtilSameOrigin {
 parameterSets.add(new Object[] { request4, "http://example.com:80";, 
Boolean.FALSE });
 parameterSets.add(new Object[] { request4, "http://example.com:8080";, 
Boolean.TRUE});
 
+parameterSets.add(new Object[]{ request5, "http://example.com:80";, 
Boolean.FALSE});
+parameterSets.add(new Object[]{ request5, "://example.com:80", 
Boolean.FALSE});
+parameterSets.add(new Object[]{ request5, "example.com:80", 
Boolean.FALSE});
+
+parameterSets.add(new Object[]{ request6, "http://example.com:80";, 
Boolean.FALSE});
+parameterSets.add(new Object[]{ request6, "http://:80";, 
Boolean.FALSE});
+parameterSets.add(new Object[]{ request6, "http://";, Boolean.FALSE});
+
 return parameterSets;
 }
 


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



(tomcat) branch 9.0.x updated: clean up org.apache.tomcat.util.http RequestUtil (#818)

2025-02-06 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/9.0.x by this push:
 new 8831f15f26 clean up org.apache.tomcat.util.http  RequestUtil (#818)
8831f15f26 is described below

commit 8831f15f26fcf0a359748ccff21c7928ae283fe3
Author: 김민종 
AuthorDate: Fri Feb 7 00:52:06 2025 +0900

clean up org.apache.tomcat.util.http  RequestUtil (#818)

Cleanup RequestUtil with test case
---
 java/org/apache/tomcat/util/http/RequestUtil.java | 15 ---
 .../tomcat/util/http/TestRequestUtilSameOrigin.java   | 10 ++
 2 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/java/org/apache/tomcat/util/http/RequestUtil.java 
b/java/org/apache/tomcat/util/http/RequestUtil.java
index 5ba087e996..ddca002acf 100644
--- a/java/org/apache/tomcat/util/http/RequestUtil.java
+++ b/java/org/apache/tomcat/util/http/RequestUtil.java
@@ -123,19 +123,12 @@ public class RequestUtil {
 // Build scheme://host:port from request
 StringBuilder target = new StringBuilder();
 String scheme = request.getScheme();
-if (scheme == null) {
-return false;
-} else {
-scheme = scheme.toLowerCase(Locale.ENGLISH);
-}
-target.append(scheme);
-target.append("://");
-
 String host = request.getServerName();
-if (host == null) {
+if (scheme == null || host == null) {
 return false;
 }
-target.append(host);
+scheme = scheme.toLowerCase(Locale.ENGLISH);
+target.append(scheme).append("://").append(host);
 
 int port = request.getServerPort();
 // Origin may or may not include the (default) port.
@@ -161,7 +154,7 @@ public class RequestUtil {
 
 // Both scheme and host are case-insensitive but the CORS spec states
 // this check should be case-sensitive
-return origin.equals(target.toString());
+return origin.contentEquals(target);
 }
 
 
diff --git a/test/org/apache/tomcat/util/http/TestRequestUtilSameOrigin.java 
b/test/org/apache/tomcat/util/http/TestRequestUtilSameOrigin.java
index bcb62eb5ee..30ca619d63 100644
--- a/test/org/apache/tomcat/util/http/TestRequestUtilSameOrigin.java
+++ b/test/org/apache/tomcat/util/http/TestRequestUtilSameOrigin.java
@@ -42,6 +42,8 @@ public class TestRequestUtilSameOrigin {
 TesterRequest request2 = new TesterRequest("ws", "example.com", 80);
 TesterRequest request3 = new TesterRequest("http", "example.com", 443);
 TesterRequest request4 = new TesterRequest("http", "example.com", 
8080);
+TesterRequest request5 = new TesterRequest(null, "example.com", 80);
+TesterRequest request6 = new TesterRequest("http", null, 8080);
 
 parameterSets.add(new Object[] { request1, "http://example.com";, 
Boolean.TRUE });
 parameterSets.add(new Object[] { request1, "http://example.com:80";, 
Boolean.TRUE });
@@ -59,6 +61,14 @@ public class TestRequestUtilSameOrigin {
 parameterSets.add(new Object[] { request4, "http://example.com:80";, 
Boolean.FALSE });
 parameterSets.add(new Object[] { request4, "http://example.com:8080";, 
Boolean.TRUE});
 
+parameterSets.add(new Object[]{ request5, "http://example.com:80";, 
Boolean.FALSE});
+parameterSets.add(new Object[]{ request5, "://example.com:80", 
Boolean.FALSE});
+parameterSets.add(new Object[]{ request5, "example.com:80", 
Boolean.FALSE});
+
+parameterSets.add(new Object[]{ request6, "http://example.com:80";, 
Boolean.FALSE});
+parameterSets.add(new Object[]{ request6, "http://:80";, 
Boolean.FALSE});
+parameterSets.add(new Object[]{ request6, "http://";, Boolean.FALSE});
+
 return parameterSets;
 }
 


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



(tomcat) branch 10.1.x updated: clean up org.apache.tomcat.util.http RequestUtil (#818)

2025-02-06 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/10.1.x by this push:
 new 32063efbd8 clean up org.apache.tomcat.util.http  RequestUtil (#818)
32063efbd8 is described below

commit 32063efbd837a1f757d6b4228e4a55c1f2f522e0
Author: 김민종 
AuthorDate: Fri Feb 7 00:52:06 2025 +0900

clean up org.apache.tomcat.util.http  RequestUtil (#818)

Cleanup RequestUtil with test case
---
 java/org/apache/tomcat/util/http/RequestUtil.java | 15 ---
 .../tomcat/util/http/TestRequestUtilSameOrigin.java   | 10 ++
 2 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/java/org/apache/tomcat/util/http/RequestUtil.java 
b/java/org/apache/tomcat/util/http/RequestUtil.java
index fe4d1e639a..d8bbae5c81 100644
--- a/java/org/apache/tomcat/util/http/RequestUtil.java
+++ b/java/org/apache/tomcat/util/http/RequestUtil.java
@@ -123,19 +123,12 @@ public class RequestUtil {
 // Build scheme://host:port from request
 StringBuilder target = new StringBuilder();
 String scheme = request.getScheme();
-if (scheme == null) {
-return false;
-} else {
-scheme = scheme.toLowerCase(Locale.ENGLISH);
-}
-target.append(scheme);
-target.append("://");
-
 String host = request.getServerName();
-if (host == null) {
+if (scheme == null || host == null) {
 return false;
 }
-target.append(host);
+scheme = scheme.toLowerCase(Locale.ENGLISH);
+target.append(scheme).append("://").append(host);
 
 int port = request.getServerPort();
 // Origin may or may not include the (default) port.
@@ -161,7 +154,7 @@ public class RequestUtil {
 
 // Both scheme and host are case-insensitive but the CORS spec states
 // this check should be case-sensitive
-return origin.equals(target.toString());
+return origin.contentEquals(target);
 }
 
 
diff --git a/test/org/apache/tomcat/util/http/TestRequestUtilSameOrigin.java 
b/test/org/apache/tomcat/util/http/TestRequestUtilSameOrigin.java
index 49882c3204..2524eecaf2 100644
--- a/test/org/apache/tomcat/util/http/TestRequestUtilSameOrigin.java
+++ b/test/org/apache/tomcat/util/http/TestRequestUtilSameOrigin.java
@@ -42,6 +42,8 @@ public class TestRequestUtilSameOrigin {
 TesterRequest request2 = new TesterRequest("ws", "example.com", 80);
 TesterRequest request3 = new TesterRequest("http", "example.com", 443);
 TesterRequest request4 = new TesterRequest("http", "example.com", 
8080);
+TesterRequest request5 = new TesterRequest(null, "example.com", 80);
+TesterRequest request6 = new TesterRequest("http", null, 8080);
 
 parameterSets.add(new Object[] { request1, "http://example.com";, 
Boolean.TRUE });
 parameterSets.add(new Object[] { request1, "http://example.com:80";, 
Boolean.TRUE });
@@ -59,6 +61,14 @@ public class TestRequestUtilSameOrigin {
 parameterSets.add(new Object[] { request4, "http://example.com:80";, 
Boolean.FALSE });
 parameterSets.add(new Object[] { request4, "http://example.com:8080";, 
Boolean.TRUE});
 
+parameterSets.add(new Object[]{ request5, "http://example.com:80";, 
Boolean.FALSE});
+parameterSets.add(new Object[]{ request5, "://example.com:80", 
Boolean.FALSE});
+parameterSets.add(new Object[]{ request5, "example.com:80", 
Boolean.FALSE});
+
+parameterSets.add(new Object[]{ request6, "http://example.com:80";, 
Boolean.FALSE});
+parameterSets.add(new Object[]{ request6, "http://:80";, 
Boolean.FALSE});
+parameterSets.add(new Object[]{ request6, "http://";, Boolean.FALSE});
+
 return parameterSets;
 }
 


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: [PR] Fix null stream issue for resource loading based on relative names [tomcat]

2025-02-06 Thread via GitHub


markt-asf commented on PR #816:
URL: https://github.com/apache/tomcat/pull/816#issuecomment-2640347996

   The Java documentation for resource names also states:
   
   > The methods in ClassLoader use the given String as the name of the 
resource without applying any absolute/relative transformation (see the methods 
in Class). The name should not have a leading "/".
   
   That doesn't mean the issue isn't going to be fixed in Tomcat. But it does 
mean it looks like CXF has a bug that should be fixed.


-- 
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: dev-unsubscr...@tomcat.apache.org

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


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: [PR] Fix null stream issue for resource loading based on relative names [tomcat]

2025-02-06 Thread via GitHub


markt-asf commented on PR #816:
URL: https://github.com/apache/tomcat/pull/816#issuecomment-2640460519

   And given that `addURL()` is a protected method, how are you calling it?


-- 
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: dev-unsubscr...@tomcat.apache.org

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


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: [PR] clean up org.apache.tomcat.util.http RequestUtil [tomcat]

2025-02-06 Thread via GitHub


markt-asf commented on code in PR #818:
URL: https://github.com/apache/tomcat/pull/818#discussion_r1944967982


##
java/org/apache/tomcat/util/http/RequestUtil.java:
##
@@ -123,19 +123,12 @@ public static boolean isSameOrigin(HttpServletRequest 
request, String origin) {
 // Build scheme://host:port from request
 StringBuilder target = new StringBuilder();
 String scheme = request.getScheme();
-if (scheme == null) {
-return false;
-} else {
-scheme = scheme.toLowerCase(Locale.ENGLISH);
-}
-target.append(scheme);
-target.append("://");
-
 String host = request.getServerName();
-if (host == null) {
+if (scheme == null || host == null) {
 return false;
 }
-target.append(host);
+scheme = scheme.toLowerCase(Locale.ENGLISH);
+target.append(scheme).append("://").append(host);

Review Comment:
   It is marginally less efficient because it calls request.getServerName() 
even if the scheme is null. But it isn't a big deal.



-- 
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: dev-unsubscr...@tomcat.apache.org

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


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



(tomcat) branch main updated: clean up org.apache.tomcat.util.http RequestUtil (#818)

2025-02-06 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/main by this push:
 new ec48b80476 clean up org.apache.tomcat.util.http  RequestUtil (#818)
ec48b80476 is described below

commit ec48b8047674c586815abdca6d83990b70691ccb
Author: 김민종 
AuthorDate: Fri Feb 7 00:52:06 2025 +0900

clean up org.apache.tomcat.util.http  RequestUtil (#818)

Cleanup RequestUtil with test case
---
 java/org/apache/tomcat/util/http/RequestUtil.java | 15 ---
 .../tomcat/util/http/TestRequestUtilSameOrigin.java   | 10 ++
 2 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/java/org/apache/tomcat/util/http/RequestUtil.java 
b/java/org/apache/tomcat/util/http/RequestUtil.java
index fe4d1e639a..d8bbae5c81 100644
--- a/java/org/apache/tomcat/util/http/RequestUtil.java
+++ b/java/org/apache/tomcat/util/http/RequestUtil.java
@@ -123,19 +123,12 @@ public class RequestUtil {
 // Build scheme://host:port from request
 StringBuilder target = new StringBuilder();
 String scheme = request.getScheme();
-if (scheme == null) {
-return false;
-} else {
-scheme = scheme.toLowerCase(Locale.ENGLISH);
-}
-target.append(scheme);
-target.append("://");
-
 String host = request.getServerName();
-if (host == null) {
+if (scheme == null || host == null) {
 return false;
 }
-target.append(host);
+scheme = scheme.toLowerCase(Locale.ENGLISH);
+target.append(scheme).append("://").append(host);
 
 int port = request.getServerPort();
 // Origin may or may not include the (default) port.
@@ -161,7 +154,7 @@ public class RequestUtil {
 
 // Both scheme and host are case-insensitive but the CORS spec states
 // this check should be case-sensitive
-return origin.equals(target.toString());
+return origin.contentEquals(target);
 }
 
 
diff --git a/test/org/apache/tomcat/util/http/TestRequestUtilSameOrigin.java 
b/test/org/apache/tomcat/util/http/TestRequestUtilSameOrigin.java
index e47e7d80d3..40a9bde55a 100644
--- a/test/org/apache/tomcat/util/http/TestRequestUtilSameOrigin.java
+++ b/test/org/apache/tomcat/util/http/TestRequestUtilSameOrigin.java
@@ -42,6 +42,8 @@ public class TestRequestUtilSameOrigin {
 TesterRequest request2 = new TesterRequest("ws", "example.com", 80);
 TesterRequest request3 = new TesterRequest("http", "example.com", 443);
 TesterRequest request4 = new TesterRequest("http", "example.com", 
8080);
+TesterRequest request5 = new TesterRequest(null, "example.com", 80);
+TesterRequest request6 = new TesterRequest("http", null, 8080);
 
 parameterSets.add(new Object[] { request1, "http://example.com";, 
Boolean.TRUE });
 parameterSets.add(new Object[] { request1, "http://example.com:80";, 
Boolean.TRUE });
@@ -59,6 +61,14 @@ public class TestRequestUtilSameOrigin {
 parameterSets.add(new Object[] { request4, "http://example.com:80";, 
Boolean.FALSE });
 parameterSets.add(new Object[] { request4, "http://example.com:8080";, 
Boolean.TRUE});
 
+parameterSets.add(new Object[]{ request5, "http://example.com:80";, 
Boolean.FALSE});
+parameterSets.add(new Object[]{ request5, "://example.com:80", 
Boolean.FALSE});
+parameterSets.add(new Object[]{ request5, "example.com:80", 
Boolean.FALSE});
+
+parameterSets.add(new Object[]{ request6, "http://example.com:80";, 
Boolean.FALSE});
+parameterSets.add(new Object[]{ request6, "http://:80";, 
Boolean.FALSE});
+parameterSets.add(new Object[]{ request6, "http://";, Boolean.FALSE});
+
 return parameterSets;
 }
 


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: [PR] clean up org.apache.tomcat.util.http RequestUtil [tomcat]

2025-02-06 Thread via GitHub


markt-asf merged PR #818:
URL: https://github.com/apache/tomcat/pull/818


-- 
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: dev-unsubscr...@tomcat.apache.org

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


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: [PR] Fix null stream issue for resource loading based on relative names [tomcat]

2025-02-06 Thread via GitHub


AmshikaH commented on PR #816:
URL: https://github.com/apache/tomcat/pull/816#issuecomment-2640684009

   > But it does mean it looks like CXF has a bug that should be fixed.
   
   Thank you for pointing this out. I will make a report of this via CXF's Jira 
board.
   
   > And given that addURL() is a protected method, how are you calling it?
   
   We are using a custom class loader that extends Tomcat's WebappClassLoader, 
which makes our custom class loader a subclass of Tomcat's 
WebappClassLoaderBase. 
   
   > * Tomcat 12 onwards return `null` if the name starts with `/`
   > * Tomcat 11 and earlier, skip the `notFoundClassResources` cache if the 
name starts with '/'
   >
   > Apps that use incorrect resource names may see a small performance 
degradation if they try loading the same resource multiple times using the 
wrong format for a resource name. The fix for that would be for the app to use 
the correct format.
   
   Thank you, a fix would be much appreciated. 


-- 
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: dev-unsubscr...@tomcat.apache.org

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


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org