You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by gc...@apache.org on 2022/05/11 17:42:01 UTC

[allura] 01/01: [#8429] adding noindex,follow header to auth redirects

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

gcruz pushed a commit to branch gc/8429
in repository https://gitbox.apache.org/repos/asf/allura.git

commit 0da3ce6cd0de2f1f59f73df5f3d99ec3b9eaa21a
Author: Guillermo Cruz <gu...@slashdotmedia.com>
AuthorDate: Wed May 11 11:41:53 2022 -0600

    [#8429] adding noindex,follow header to auth redirects
---
 Allura/allura/lib/custom_middleware.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Allura/allura/lib/custom_middleware.py b/Allura/allura/lib/custom_middleware.py
index edcc4dbff..ca97111f0 100644
--- a/Allura/allura/lib/custom_middleware.py
+++ b/Allura/allura/lib/custom_middleware.py
@@ -165,7 +165,7 @@ class LoginRedirectMiddleware:
             else:
                 # Don't try to re-post; the body has been lost.
                 location = tg.url(login_url)
-            r = exc.HTTPFound(location=location)
+            r = exc.HTTPFound(location=location, headers={'X-Robots-Tag': 'noindex,follow'})
             return r(environ, start_response)
         start_response(status, headers, exc_info)
         return app_iter