cassandra-pr mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [cassandra-website] ossarga commented on a change in pull request #5: Always use https
Date Thu, 23 Apr 2020 06:07:11 GMT

ossarga commented on a change in pull request #5:
URL: https://github.com/apache/cassandra-website/pull/5#discussion_r413529482



##########
File path: src/.htaccess
##########
@@ -1 +1,4 @@
 RewriteEngine On
+
+RewriteCond %{HTTPS} !=on

Review comment:
       In the Apache [mod_rewrite spec|https://httpd.apache.org/docs/current/mod/mod_rewrite.html#RewriteCond]
it says
   
   > The string comparison operator is part of the CondPattern argument and must be included
in the quotes if those are used. Eg.
   ```
   RewriteCond %{HTTP_USER_AGENT} "=This Robot/1.0"
   ```
   
   Should the `!=on` be enclosed in quotes i.e. `"!=on"`?

##########
File path: src/.htaccess
##########
@@ -1 +1,4 @@
 RewriteEngine On
+
+RewriteCond %{HTTPS} !=on
+RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]

Review comment:
       The `SERVER_NAME` Server-Variable maps to the [ServerName Directive|https://httpd.apache.org/docs/current/mod/core.html#servername].
The syntax for this directive says that it can optionally include the scheme. This may cause
problems with the rewrite rule if a scheme is included in the server name. Is it worth using
the `HTTP_HOST` instead? The downside I see to this is that `HTTP_HOST` is the host name only
where as the `SERVER_NAME` can include the port number.




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



---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


Mime
View raw message