Re: Use of "constants" in Manager to generate HTML/CSS content

2020-08-10 Thread Martin Grigorov
On Tue, Jul 28, 2020, 16:48 Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> All,
>
> I was looking at this PR[1] and wondering why we have huge swaths of
> CSS and HTML in a Java source file, instead of using e.g. JSP or some
> other content-generation framework.
>
> I know, I hate JSP, too, but having large blocks of HTML and CSS in
> Java strings is just ... awful.
>
> Also, is there a particular reason we are using embedded CSS in the
> pages instead of an external CSS file?
>
> Ultimately, it would be a good idea to move all CSS and even styles
> into a separate CSS file so we can tighten-up the Content Security
> Policy on the manager app. This can help prevent attacks if there
> happens to be some kind of XSS vulnerability hiding in there somewhere.
>
> Any objections to evicting the CSS to begin with?
>

+1


> Thanks,
> - -chris
>
> [1] https://github.com/apache/tomcat/pull/327
> -BEGIN PGP SIGNATURE-
> Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/
>
> iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl8gLJsACgkQHPApP6U8
> pFgKCw//WY8p/EBS7sxDYgnV6W4pjeuAuhXv6ierajPH28NfdokIRlU4IfFIUVIE
> Ck98rK9uH98o6QFkWC70MVYV+NbEi4CwrjPhuFV/rEplyqfA+Ijs5g069a1g15On
> fw5V44CK2JBj0AjT4ZtMVWOSxDElHZc3SjZmyaie0pk2zDVxYwSwhoRPtqzms5rH
> zTlu48R14t1O9PLsWGthwdVStAn9WlE7hBLI3yLag/QKUqlOR/a8Fy75mbMma5a9
> cmG8Lh5Jo8a6YzD0q37sdOmKN5d9lZxZkz3x21Cy3v2qcKcaGUcAttAEe9hFKEzh
> I0hOMKYc/2n2aNpMTjIkG86fXzAYB1IIsfiGxlwP/nY6HzJ9XRolD9+kT7LZ/tP3
> 7SKL8rVoKi5SWiH+g3jGifVkxfiHlMhvZikAbC75ngP7mNXZFHPdnF3rvai/cbum
> FWUpLDoW/oTs87v9l071hs+hf2PffvqL/v5AeoMbGf/VDpf/zcuNy0wlB2w6Nxo9
> K8sBVHQGJzIlaR9fqLyYJkJ8kmSb37t7BxPXLuGSCr98uUD8bSy2IwC2IxessXQc
> E+oIyJ0mlPdKU1dh5yFtMzCp4S9olUg4diqOxpToGm2hnmdnkRY3OarC1OU839NC
> Yd5uYA9XoYxBro2oNfB1gCNB5Ve4aLVOV0Q3iKcW83b8jLiNgzY=
> =Z+cI
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: dev-h...@tomcat.apache.org
>
>


Re: How to run individual Test

2020-08-10 Thread Igal Sapir
Saksham,

On Mon, Aug 10, 2020 at 9:46 AM Saksham Verma 
wrote:

> Hi Dev Team,
>
> Need help with below questions:
>
> 1. The Pull request Tests are failing on Travis CI. But Is there any way I
> can get the logs for the test job?
>
> 2. How can I run any individual test.
>

See section 7 of the BUILDING.txt [1] file.

Igal

[1] https://github.com/apache/tomcat/blob/master/BUILDING.txt#L308




> Whenever I am trying to run a single test I get below error:
> java.lang.VerifyError: Inconsistent stackmap frames at branch target 392
> Exception Details:
>   Location:
>
> org/apache/juli/ClassLoaderLogManager.readConfiguration(Ljava/lang/ClassLoader;)V
> @392: ldc_w
>   Reason:
> Type uninitialized 370 (current frame, stack[2]) is not assignable to
> uninitialized 366 (stack map, stack[2])
>   Current Frame:
> bci: @383
> flags: { }
> locals: { 'org/apache/juli/ClassLoaderLogManager',
> 'java/lang/ClassLoader', 'java/io/InputStream', 'java/lang/String' }
> stack: { uninitialized 366, uninitialized 366, uninitialized 370,
> uninitialized 370, 'java/lang/String', integer }
>   Stackmap Frame:
> bci: @392
> flags: { }
> locals: { 'org/apache/juli/ClassLoaderLogManager',
> 'java/lang/ClassLoader', 'java/io/InputStream', 'java/lang/String' }
> stack: { uninitialized 366, uninitialized 366, uninitialized 366,
> uninitialized 366, 'java/lang/String' }
>   Bytecode:
>
> Thanks,
> Saksham
>


How to run individual Test

2020-08-10 Thread Saksham Verma
Hi Dev Team,

Need help with below questions:

1. The Pull request Tests are failing on Travis CI. But Is there any way I
can get the logs for the test job?

2. How can I run any individual test. Whenever I am trying to run a single
test I get below error:
java.lang.VerifyError: Inconsistent stackmap frames at branch target 392
Exception Details:
  Location:

org/apache/juli/ClassLoaderLogManager.readConfiguration(Ljava/lang/ClassLoader;)V
@392: ldc_w
  Reason:
Type uninitialized 370 (current frame, stack[2]) is not assignable to
uninitialized 366 (stack map, stack[2])
  Current Frame:
bci: @383
flags: { }
locals: { 'org/apache/juli/ClassLoaderLogManager',
'java/lang/ClassLoader', 'java/io/InputStream', 'java/lang/String' }
stack: { uninitialized 366, uninitialized 366, uninitialized 370,
uninitialized 370, 'java/lang/String', integer }
  Stackmap Frame:
bci: @392
flags: { }
locals: { 'org/apache/juli/ClassLoaderLogManager',
'java/lang/ClassLoader', 'java/io/InputStream', 'java/lang/String' }
stack: { uninitialized 366, uninitialized 366, uninitialized 366,
uninitialized 366, 'java/lang/String' }
  Bytecode:

Thanks,
Saksham


[tomcat] branch 9.0.x updated: Add some Javadoc to silence a handful of IDE warnings

2020-08-10 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 300c852  Add some Javadoc to silence a handful of IDE warnings
300c852 is described below

commit 300c8527a6b3a9dfbd4c9c103e2995a6e00ee779
Author: Mark Thomas 
AuthorDate: Mon Aug 10 17:02:47 2020 +0100

Add some Javadoc to silence a handful of IDE warnings
---
 .../tomcat/util/XReflectionIntrospectionUtils.java | 18 ++
 1 file changed, 18 insertions(+)

diff --git a/java/org/apache/tomcat/util/XReflectionIntrospectionUtils.java 
b/java/org/apache/tomcat/util/XReflectionIntrospectionUtils.java
index 88de048..021c90e 100644
--- a/java/org/apache/tomcat/util/XReflectionIntrospectionUtils.java
+++ b/java/org/apache/tomcat/util/XReflectionIntrospectionUtils.java
@@ -22,10 +22,28 @@ final class XReflectionIntrospectionUtils {
 return false;
 }
 
+/**
+ * Always throws {@link UnsupportedOperationException}
+ *
+ * @param o Unused
+ * @param name  Unused
+ *
+ * @return Never returns normally
+ */
 static Object getPropertyInternal(Object o, String name) {
 throw new UnsupportedOperationException();
 }
 
+/**
+ * Always throws {@link UnsupportedOperationException}
+ *
+ * @param o Unused
+ * @param name  Unused
+ * @param value Unused
+ * @param invokeSetProperty Unused
+ *
+ * @return Never returns normally
+ */
 static boolean setPropertyInternal(Object o, String name, String value, 
boolean invokeSetProperty) {
 throw new UnsupportedOperationException();
 }


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



[GitHub] [tomcat] markt-asf closed pull request #324: Change ETag format to Nginx like

2020-08-10 Thread GitBox


markt-asf closed pull request #324:
URL: https://github.com/apache/tomcat/pull/324


   



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:
us...@infra.apache.org



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



[GitHub] [tomcat] markt-asf commented on pull request #324: Change ETag format to Nginx like

2020-08-10 Thread GitBox


markt-asf commented on pull request #324:
URL: https://github.com/apache/tomcat/pull/324#issuecomment-671460229


   I have refactored the DefaultServlet to make it simpler to override if a 
custom ETag format is required.
   Tomcat is not going to change the current ETag format to align with any one 
particular user's preference as experience tells us that as soon as we do that, 
a different user will express a requirement for a different format. 
Customisation is the solution that allows all users to have the format of their 
choice.



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:
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 7.0.x updated: Refactor Default servlet to simplify support for custom ETag formats

2020-08-10 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/7.0.x by this push:
 new 747aa7b  Refactor Default servlet to simplify support for custom ETag 
formats
747aa7b is described below

commit 747aa7ba11f05a39339aef8da768ec57ad005912
Author: Mark Thomas 
AuthorDate: Mon Aug 10 17:19:52 2020 +0100

Refactor Default servlet to simplify support for custom ETag formats
---
 .../apache/catalina/servlets/DefaultServlet.java   | 27 ++
 .../apache/catalina/servlets/WebdavServlet.java|  2 +-
 webapps/docs/changelog.xml |  5 
 3 files changed, 28 insertions(+), 6 deletions(-)

diff --git a/java/org/apache/catalina/servlets/DefaultServlet.java 
b/java/org/apache/catalina/servlets/DefaultServlet.java
index fa2806c..2c8ca97 100644
--- a/java/org/apache/catalina/servlets/DefaultServlet.java
+++ b/java/org/apache/catalina/servlets/DefaultServlet.java
@@ -902,7 +902,7 @@ public class DefaultServlet extends HttpServlet {
 ranges = parseRange(request, response, cacheEntry.attributes);
 
 // ETag header
-response.setHeader("ETag", cacheEntry.attributes.getETag());
+response.setHeader("ETag", 
generateETag(cacheEntry.attributes));
 
 // Last-Modified header
 response.setHeader("Last-Modified",
@@ -1181,7 +1181,7 @@ public class DefaultServlet extends HttpServlet {
 // Ignore
 }
 
-String eTag = resourceAttributes.getETag();
+String eTag = generateETag(resourceAttributes);
 long lastModified = resourceAttributes.getLastModified();
 
 if (headerValueTime == (-1L)) {
@@ -1910,7 +1910,7 @@ public class DefaultServlet extends HttpServlet {
 HttpServletResponse response, ResourceAttributes 
resourceAttributes)
 throws IOException {
 
-String eTag = resourceAttributes.getETag();
+String eTag = generateETag(resourceAttributes);
 // Default servlet uses weak matching so we strip any leading "W/" and
 // then compare using equals
 if (eTag.startsWith("W/")) {
@@ -1971,7 +1971,7 @@ public class DefaultServlet extends HttpServlet {
 // The entity has not been modified since the date
 // specified by the client. This is not an error case.
 response.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
-response.setHeader("ETag", resourceAttributes.getETag());
+response.setHeader("ETag", 
generateETag(resourceAttributes));
 
 return false;
 }
@@ -1998,7 +1998,7 @@ public class DefaultServlet extends HttpServlet {
 HttpServletResponse response, ResourceAttributes 
resourceAttributes)
 throws IOException {
 
-String eTag = resourceAttributes.getETag();
+String eTag = generateETag(resourceAttributes);
 String headerValue = request.getHeader("If-None-Match");
 if (headerValue != null) {
 
@@ -2072,6 +2072,23 @@ public class DefaultServlet extends HttpServlet {
 
 
 /**
+ * Provides the entity tag (the ETag header) for the given resource
+ * attributes. Intended to be over-ridden by custom DefaultServlet
+ * implementations that wish to use an alternative format for the entity
+ * tag.
+ *
+ * @param resourceAttributes  The resource attributes for which an entity
+ *tag is required.
+ *
+ * @return The result of calling {@link ResourceAttributes#getETag()} on 
the given
+ * resource
+ */
+protected String generateETag(ResourceAttributes resourceAttributes) {
+return resourceAttributes.getETag();
+}
+
+
+/**
  * Copy the contents of the specified input stream to the specified
  * output stream, and ensure that both streams are closed before returning
  * (even in the face of an exception).
diff --git a/java/org/apache/catalina/servlets/WebdavServlet.java 
b/java/org/apache/catalina/servlets/WebdavServlet.java
index 2623a94..d8642ba 100644
--- a/java/org/apache/catalina/servlets/WebdavServlet.java
+++ b/java/org/apache/catalina/servlets/WebdavServlet.java
@@ -2128,7 +2128,7 @@ public class WebdavServlet extends DefaultServlet {
 generatePropFindResponse(generatedXML, rewrittenUrl, path, type, 
propertiesVector,
 cacheEntry.context == null, false, 
cacheEntry.attributes.getCreation(), cacheEntry.attributes.getLastModified(),
 cacheEntry.attributes.getContentLength(), 
getServletContext().getMimeType(cacheEntry.name),
-cacheEntry.attributes.getETag());
+generateETag(cacheEntry.attributes));
 }
 
 
diff --git 

[tomcat] branch 8.5.x updated: Refactor Default servlet to simplify support for custom ETag formats

2020-08-10 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/8.5.x by this push:
 new 238ca09  Refactor Default servlet to simplify support for custom ETag 
formats
238ca09 is described below

commit 238ca092e107633e589081e9dd46c8415c263bdc
Author: Mark Thomas 
AuthorDate: Mon Aug 10 17:19:52 2020 +0100

Refactor Default servlet to simplify support for custom ETag formats
---
 .../apache/catalina/servlets/DefaultServlet.java   | 25 +-
 .../apache/catalina/servlets/WebdavServlet.java|  2 +-
 webapps/docs/changelog.xml |  5 +
 3 files changed, 26 insertions(+), 6 deletions(-)

diff --git a/java/org/apache/catalina/servlets/DefaultServlet.java 
b/java/org/apache/catalina/servlets/DefaultServlet.java
index 571c754..a89148b 100644
--- a/java/org/apache/catalina/servlets/DefaultServlet.java
+++ b/java/org/apache/catalina/servlets/DefaultServlet.java
@@ -912,7 +912,7 @@ public class DefaultServlet extends HttpServlet {
 String eTag = null;
 String lastModifiedHttp = null;
 if (resource.isFile() && !isError) {
-eTag = resource.getETag();
+eTag = generateETag(resource);
 lastModifiedHttp = resource.getLastModifiedHttp();
 }
 
@@ -1480,7 +1480,7 @@ public class DefaultServlet extends HttpServlet {
 // Ignore
 }
 
-String eTag = resource.getETag();
+String eTag = generateETag(resource);
 long lastModified = resource.getLastModified();
 
 if (headerValueTime == (-1L)) {
@@ -2307,7 +2307,7 @@ public class DefaultServlet extends HttpServlet {
 HttpServletResponse response, WebResource resource)
 throws IOException {
 
-String eTag = resource.getETag();
+String eTag = generateETag(resource);
 // Default servlet uses weak matching so we strip any leading "W/" and
 // then compare using equals
 if (eTag.startsWith("W/")) {
@@ -2368,7 +2368,7 @@ public class DefaultServlet extends HttpServlet {
 // The entity has not been modified since the date
 // specified by the client. This is not an error case.
 response.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
-response.setHeader("ETag", resource.getETag());
+response.setHeader("ETag", generateETag(resource));
 
 return false;
 }
@@ -2395,7 +2395,7 @@ public class DefaultServlet extends HttpServlet {
 HttpServletResponse response, WebResource resource)
 throws IOException {
 
-String eTag = resource.getETag();
+String eTag = generateETag(resource);
 String headerValue = request.getHeader("If-None-Match");
 if (headerValue != null) {
 
@@ -2469,6 +2469,21 @@ public class DefaultServlet extends HttpServlet {
 
 
 /**
+ * Provides the entity tag (the ETag header) for the given resource.
+ * Intended to be over-ridden by custom DefaultServlet implementations that
+ * wish to use an alternative format for the entity tag.
+ *
+ * @param resource  The resource for which an entity tag is required.
+ *
+ * @return The result of calling {@link WebResource#getETag()} on the given
+ * resource
+ */
+protected String generateETag(WebResource resource) {
+return resource.getETag();
+}
+
+
+/**
  * Copy the contents of the specified input stream to the specified
  * output stream, and ensure that both streams are closed before returning
  * (even in the face of an exception).
diff --git a/java/org/apache/catalina/servlets/WebdavServlet.java 
b/java/org/apache/catalina/servlets/WebdavServlet.java
index b3c558d..30db796 100644
--- a/java/org/apache/catalina/servlets/WebdavServlet.java
+++ b/java/org/apache/catalina/servlets/WebdavServlet.java
@@ -1997,7 +1997,7 @@ public class WebdavServlet extends DefaultServlet {
 generatePropFindResponse(generatedXML, rewrittenUrl, path, type, 
propertiesVector,
 resource.isFile(), false, resource.getCreation(), 
resource.getLastModified(),
 resource.getContentLength(), 
getServletContext().getMimeType(resource.getName()),
-resource.getETag());
+generateETag(resource));
 }
 
 
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 47413b6..a59bff9 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -63,6 +63,11 @@
 issuing the 404 response to give the rewrite valve, if configured, an
 opportunity to rewrite the request. (remm/markt)
   
+  
+Refactor the Default servlet to provide a single method that can be
+

[tomcat] branch 9.0.x updated: Refactor Default servlet to simplify support for custom ETag formats

2020-08-10 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 89ed1b6  Refactor Default servlet to simplify support for custom ETag 
formats
89ed1b6 is described below

commit 89ed1b6e76c9b667d513468753451db4b924e48a
Author: Mark Thomas 
AuthorDate: Mon Aug 10 17:19:52 2020 +0100

Refactor Default servlet to simplify support for custom ETag formats
---
 .../apache/catalina/servlets/DefaultServlet.java   | 25 +-
 .../apache/catalina/servlets/WebdavServlet.java|  2 +-
 webapps/docs/changelog.xml |  5 +
 3 files changed, 26 insertions(+), 6 deletions(-)

diff --git a/java/org/apache/catalina/servlets/DefaultServlet.java 
b/java/org/apache/catalina/servlets/DefaultServlet.java
index 2601899..51f7881 100644
--- a/java/org/apache/catalina/servlets/DefaultServlet.java
+++ b/java/org/apache/catalina/servlets/DefaultServlet.java
@@ -905,7 +905,7 @@ public class DefaultServlet extends HttpServlet {
 String eTag = null;
 String lastModifiedHttp = null;
 if (resource.isFile() && !isError) {
-eTag = resource.getETag();
+eTag = generateETag(resource);
 lastModifiedHttp = resource.getLastModifiedHttp();
 }
 
@@ -1473,7 +1473,7 @@ public class DefaultServlet extends HttpServlet {
 // Ignore
 }
 
-String eTag = resource.getETag();
+String eTag = generateETag(resource);
 long lastModified = resource.getLastModified();
 
 if (headerValueTime == (-1L)) {
@@ -2228,7 +2228,7 @@ public class DefaultServlet extends HttpServlet {
 HttpServletResponse response, WebResource resource)
 throws IOException {
 
-String eTag = resource.getETag();
+String eTag = generateETag(resource);
 // Default servlet uses weak matching so we strip any leading "W/" and
 // then compare using equals
 if (eTag.startsWith("W/")) {
@@ -2289,7 +2289,7 @@ public class DefaultServlet extends HttpServlet {
 // The entity has not been modified since the date
 // specified by the client. This is not an error case.
 response.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
-response.setHeader("ETag", resource.getETag());
+response.setHeader("ETag", generateETag(resource));
 
 return false;
 }
@@ -2316,7 +2316,7 @@ public class DefaultServlet extends HttpServlet {
 HttpServletResponse response, WebResource resource)
 throws IOException {
 
-String eTag = resource.getETag();
+String eTag = generateETag(resource);
 String headerValue = request.getHeader("If-None-Match");
 if (headerValue != null) {
 
@@ -2390,6 +2390,21 @@ public class DefaultServlet extends HttpServlet {
 
 
 /**
+ * Provides the entity tag (the ETag header) for the given resource.
+ * Intended to be over-ridden by custom DefaultServlet implementations that
+ * wish to use an alternative format for the entity tag.
+ *
+ * @param resource  The resource for which an entity tag is required.
+ *
+ * @return The result of calling {@link WebResource#getETag()} on the given
+ * resource
+ */
+protected String generateETag(WebResource resource) {
+return resource.getETag();
+}
+
+
+/**
  * Copy the contents of the specified input stream to the specified
  * output stream, and ensure that both streams are closed before returning
  * (even in the face of an exception).
diff --git a/java/org/apache/catalina/servlets/WebdavServlet.java 
b/java/org/apache/catalina/servlets/WebdavServlet.java
index 228bab0..c6773c7 100644
--- a/java/org/apache/catalina/servlets/WebdavServlet.java
+++ b/java/org/apache/catalina/servlets/WebdavServlet.java
@@ -1993,7 +1993,7 @@ public class WebdavServlet extends DefaultServlet {
 generatePropFindResponse(generatedXML, rewrittenUrl, path, type, 
propertiesVector,
 resource.isFile(), false, resource.getCreation(), 
resource.getLastModified(),
 resource.getContentLength(), 
getServletContext().getMimeType(resource.getName()),
-resource.getETag());
+generateETag(resource));
 }
 
 
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index dbcb5a6..1dd816b 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -69,6 +69,11 @@
 Add a dedicated loader for generated code to avoid dynamic class
 loading. (remm)
   
+  
+Refactor the Default servlet to provide a single method that can be
+overridden (generateETag()) should a custom 

[tomcat] branch master updated: Refactor Default servlet to simplify support for custom ETag formats

2020-08-10 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new 2f19d16  Refactor Default servlet to simplify support for custom ETag 
formats
2f19d16 is described below

commit 2f19d166d4f095d0715bcefd294e87a83f7661ac
Author: Mark Thomas 
AuthorDate: Mon Aug 10 17:19:52 2020 +0100

Refactor Default servlet to simplify support for custom ETag formats
---
 .../apache/catalina/servlets/DefaultServlet.java   | 25 +-
 .../apache/catalina/servlets/WebdavServlet.java|  2 +-
 webapps/docs/changelog.xml |  5 +
 3 files changed, 26 insertions(+), 6 deletions(-)

diff --git a/java/org/apache/catalina/servlets/DefaultServlet.java 
b/java/org/apache/catalina/servlets/DefaultServlet.java
index 5ffc548..466f1df 100644
--- a/java/org/apache/catalina/servlets/DefaultServlet.java
+++ b/java/org/apache/catalina/servlets/DefaultServlet.java
@@ -905,7 +905,7 @@ public class DefaultServlet extends HttpServlet {
 String eTag = null;
 String lastModifiedHttp = null;
 if (resource.isFile() && !isError) {
-eTag = resource.getETag();
+eTag = generateETag(resource);
 lastModifiedHttp = resource.getLastModifiedHttp();
 }
 
@@ -1494,7 +1494,7 @@ public class DefaultServlet extends HttpServlet {
 // Ignore
 }
 
-String eTag = resource.getETag();
+String eTag = generateETag(resource);
 long lastModified = resource.getLastModified();
 
 if (headerValueTime == (-1L)) {
@@ -2161,7 +2161,7 @@ public class DefaultServlet extends HttpServlet {
 HttpServletResponse response, WebResource resource)
 throws IOException {
 
-String eTag = resource.getETag();
+String eTag = generateETag(resource);
 // Default servlet uses weak matching so we strip any leading "W/" and
 // then compare using equals
 if (eTag.startsWith("W/")) {
@@ -,7 +,7 @@ public class DefaultServlet extends HttpServlet {
 // The entity has not been modified since the date
 // specified by the client. This is not an error case.
 response.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
-response.setHeader("ETag", resource.getETag());
+response.setHeader("ETag", generateETag(resource));
 
 return false;
 }
@@ -2249,7 +2249,7 @@ public class DefaultServlet extends HttpServlet {
 HttpServletResponse response, WebResource resource)
 throws IOException {
 
-String eTag = resource.getETag();
+String eTag = generateETag(resource);
 String headerValue = request.getHeader("If-None-Match");
 if (headerValue != null) {
 
@@ -2323,6 +2323,21 @@ public class DefaultServlet extends HttpServlet {
 
 
 /**
+ * Provides the entity tag (the ETag header) for the given resource.
+ * Intended to be over-ridden by custom DefaultServlet implementations that
+ * wish to use an alternative format for the entity tag.
+ *
+ * @param resource  The resource for which an entity tag is required.
+ *
+ * @return The result of calling {@link WebResource#getETag()} on the given
+ * resource
+ */
+protected String generateETag(WebResource resource) {
+return resource.getETag();
+}
+
+
+/**
  * Copy the contents of the specified input stream to the specified
  * output stream, and ensure that both streams are closed before returning
  * (even in the face of an exception).
diff --git a/java/org/apache/catalina/servlets/WebdavServlet.java 
b/java/org/apache/catalina/servlets/WebdavServlet.java
index 63d352e..b02433d 100644
--- a/java/org/apache/catalina/servlets/WebdavServlet.java
+++ b/java/org/apache/catalina/servlets/WebdavServlet.java
@@ -1994,7 +1994,7 @@ public class WebdavServlet extends DefaultServlet {
 generatePropFindResponse(generatedXML, rewrittenUrl, path, type, 
propertiesVector,
 resource.isFile(), false, resource.getCreation(), 
resource.getLastModified(),
 resource.getContentLength(), 
getServletContext().getMimeType(resource.getName()),
-resource.getETag());
+generateETag(resource));
 }
 
 
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index e1c8e04..f3bef3f 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -69,6 +69,11 @@
 Add a dedicated loader for generated code to avoid dynamic class
 loading. (remm)
   
+  
+Refactor the Default servlet to provide a single method that can be
+overridden (generateETag()) should a 

[tomcat] branch master updated (ec5e948 -> bf3bff9)

2020-08-10 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


from ec5e948  Merge pull request #309 from jfclere/trunk
 add bf3bff9  Add some Javadoc to silence a handful of IDE warnings

No new revisions were added by this update.

Summary of changes:
 .../tomcat/util/XReflectionIntrospectionUtils.java | 18 ++
 1 file changed, 18 insertions(+)


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



Re: Use of "constants" in Manager to generate HTML/CSS content

2020-08-10 Thread Mark Thomas
On 28/07/2020 14:48, Christopher Schultz wrote:
> All,
> 
> I was looking at this PR[1] and wondering why we have huge swaths of
> CSS and HTML in a Java source file, instead of using e.g. JSP or some
> other content-generation framework.
> 
> I know, I hate JSP, too, but having large blocks of HTML and CSS in
> Java strings is just ... awful.
> 
> Also, is there a particular reason we are using embedded CSS in the
> pages instead of an external CSS file?
> 
> Ultimately, it would be a good idea to move all CSS and even styles
> into a separate CSS file so we can tighten-up the Content Security
> Policy on the manager app. This can help prevent attacks if there
> happens to be some kind of XSS vulnerability hiding in there somewhere.
> 
> Any objections to evicting the CSS to begin with?

+1

No objections here.

Mark

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



[PROPOSAL] Remove the functional specs from docs webapp

2020-08-10 Thread Mark Thomas
Hi all,

I'd like to propose removing all the functional spec pages from the
documentation web application.

My reasoning for this proposal is, in short, that we aren't using or
maintaining these pages.

I don't recall any discussion of these docs on the dev list, proposals
to change them, proposals for additions etc.

There have been changes but going back over the changes from the last 10
years (and there are very few of them) they each appear to be part of a
wider global change that is updating something or removing references to
a feature that has been removed.

Should someone want to revive these pages, or more likely a subset of
them, they'll always be in the history.

Thoughts?

Mark

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



[Bug 63505] enhancement - support of stored procedures for DataSourceRealm authentication

2020-08-10 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63505

--- Comment #7 from Mark Thomas  ---
I agree we need to deprecate the JDBCREalm although that is a little off-topic
here.

I think we need:
- a (non-abstract?) base class that uses PreparedStatements
- a concrete implementation as per the current DataSourceRealm that extends the
base class and builds the PreparedStatements from table and column names
- a concrete implementation that extends the base class and builds the
PreparedStatements from stored procedure names (since CallableStatement extends
PreparedStatement)

Having all three classes as concrete realm implementations would allow maximum
flexibility (and maximum opportunity to shoot yourself in the foot).

-- 
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 64628] tomcat6/7/8/9 processorCache is no remove from the processors of RequestGroupInfo in concurrent release

2020-08-10 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=64628

Mark Thomas  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |INVALID

--- Comment #3 from Mark Thomas  ---
The root cause analysis is not correct.

While the size of the cache may exceed the configured size slightly (as per the
comment) it won't exceed it excessively as shown in the attachment.

9.0.5 is 2.5 years old and there have been many fixes since then including at
least one that addresses an issue that has the same symptoms as presented here.

If the issue is still observable with the latest 9.0.x release then feel free
to re-open this issue, provide the *minimal* steps to recreate it from a clean
install and someone will take a look.

-- 
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: [Bug 60030] Run away CPU with JSSE / OpenSSL with IE8

2020-08-10 Thread Felix Schumacher
Am 10.08.20 um 06:05 schrieb bugzi...@apache.org:
> https://bz.apache.org/bugzilla/show_bug.cgi?id=60030
>
> --- Comment #5 from aflaputrirohani  ---

Spam reverted and the account has been disabled.

 Felix


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



Re: [Bug 60030] Run away CPU with JSSE / OpenSSL with IE8

2020-08-10 Thread Felix Schumacher
Am 10.08.20 um 09:55 schrieb bugzi...@apache.org:
> https://bz.apache.org/bugzilla/show_bug.cgi?id=60030
>
> --- Comment #7 from martina eye  ---

Spam reverted and the account has been disabled.

 Felix


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



[Bug 60030] Run away CPU with JSSE / OpenSSL with IE8

2020-08-10 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=60030

--- Comment #6 from martina eye  ---
Perkembangan drama Korea ini menarik untuk disimak bukan hanya dari segi alur
cerita dan kualitas dramanya saja, tetapi dari segi perkembangan genre,
pemainnya, bahkan para penggemarnya. Berikut perjalanan sejarah awal kehadiran
drama Korea, atau lebih dikenal drakor, dilansir dari berbagai sumber. Situs
Streaming Yang Disajikan dengan Performa yang Sangat Cepat dan Ringan

https://dewabioskop21.biz/drama-korea
https://dewabioskop21.biz/genre/romance
https://dewabioskop21.biz/

-- 
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 60030] Run away CPU with JSSE / OpenSSL with IE8

2020-08-10 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=60030

--- Comment #7 from martina eye  ---
Sangat dianjurkan melihat cap suatu anime humor dahulu sebelum ditonton bersama
anggota keluarga ya, karena ada beberapa anime lucu dan kocak yang bercap 18+
atau 18 tahun ke atas. Jika kalian ingin mengetahui semua info lengkap tentang
update berita anime silahkan kunjungi link domigado yang sudah saya bagi ini.
Seiring kepopulerannya, drama Korea sebenarnya telah melalui beberapa tahap
perjalanan yang kemudian membuatnya berhasil bertahan dan semakin besar. Jika
kalian ingin mengetahui semua info lengkap tentang update berita idol korea
kalian silahkan kunjungi link domigado yang sudah saya bagi ini.
https://domigado.com/korea/
https://domigado.com/anime/

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



[GitHub] [tomcat] sakshamverma commented on a change in pull request #330: BZ-64644 throw an Idle Session Event on idle timeout

2020-08-10 Thread GitBox


sakshamverma commented on a change in pull request #330:
URL: https://github.com/apache/tomcat/pull/330#discussion_r467734491



##
File path: java/javax/websocket/OnIdleSession.java
##
@@ -0,0 +1,12 @@
+package javax.websocket;

Review comment:
   Would it be okay if I move it to the package org.apache.tomcat.websocket?
   And what about the other chagnes in the javax package?





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:
us...@infra.apache.org



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