You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by cz...@apache.org on 2023/07/20 12:28:46 UTC

[sling-org-apache-sling-engine] branch master updated: SLING-11974 : Add comment to method

This is an automated email from the ASF dual-hosted git repository.

cziegeler pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-engine.git


The following commit(s) were added to refs/heads/master by this push:
     new 6f3f542  SLING-11974 : Add comment to method
6f3f542 is described below

commit 6f3f5422d2601f8b51f8add5d941c55029c7a25f
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Thu Jul 20 14:28:39 2023 +0200

    SLING-11974 : Add comment to method
---
 .../java/org/apache/sling/engine/impl/SlingHttpServletRequestImpl.java  | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/main/java/org/apache/sling/engine/impl/SlingHttpServletRequestImpl.java b/src/main/java/org/apache/sling/engine/impl/SlingHttpServletRequestImpl.java
index f0ecee0..717f12f 100644
--- a/src/main/java/org/apache/sling/engine/impl/SlingHttpServletRequestImpl.java
+++ b/src/main/java/org/apache/sling/engine/impl/SlingHttpServletRequestImpl.java
@@ -342,6 +342,8 @@ public class SlingHttpServletRequestImpl extends HttpServletRequestWrapper imple
      */
     @Override
     public Principal getUserPrincipal() {
+        // we don't comply fully to the servlet spec here and might return a
+        // principal even if the request is not authenticated. See SLING-11974
         Principal principal = getResourceResolver().adaptTo(Principal.class);
         if (principal != null) {
             return principal;