joerghoh commented on code in PR #26:
URL:
https://github.com/apache/sling-org-apache-sling-servlets-get/pull/26#discussion_r4548721525
##########
src/main/java/org/apache/sling/servlets/get/impl/helpers/StreamRenderer.java:
##########
@@ -301,6 +305,15 @@ private void renderDirectory(
setHeaders(fileRes, response);
+ final boolean noExtension = index.indexOf('.') < 0;
+
+ // An index resource without extension is rendered through
"<path>.html", so the
+ // response is always HTML, no matter which content type
setHeaders() determined for
+ // the resource itself. Do it before the HEAD check so HEAD
and GET report the same type.
+ if (noExtension) {
+ response.setContentType(CONTENT_TYPE_TEXT_HTML);
+ }
Review Comment:
You are right. Let's leave it as is.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]