From 25bdc106174e23bf95c99d906b825fa64fcadee9 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Mon, 25 Feb 2019 21:01:52 +0200 Subject: [PATCH] Follow redirects for some well-known files The Server spec says that redirects should be followed for `/.well-known/matrix/server`. So we follow them. The Client-Server specs doesn't mention redirects, so we don't follow redirects there. --- roles/matrix-nginx-proxy/tasks/self_check_well_known.yml | 2 ++ roles/matrix-nginx-proxy/tasks/self_check_well_known_file.yml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/roles/matrix-nginx-proxy/tasks/self_check_well_known.yml b/roles/matrix-nginx-proxy/tasks/self_check_well_known.yml index d12e3fd3..2ea110bf 100644 --- a/roles/matrix-nginx-proxy/tasks/self_check_well_known.yml +++ b/roles/matrix-nginx-proxy/tasks/self_check_well_known.yml @@ -6,6 +6,7 @@ - path: /.well-known/matrix/client purpose: Client Discovery cors: true + follow_redirects: false - block: - set_fact: @@ -13,6 +14,7 @@ path: /.well-known/matrix/server purpose: Server Discovery cors: false + follow_redirects: true - name: Determine domains that we require certificates for (mxisd) set_fact: diff --git a/roles/matrix-nginx-proxy/tasks/self_check_well_known_file.yml b/roles/matrix-nginx-proxy/tasks/self_check_well_known_file.yml index 40161807..40fa95a6 100644 --- a/roles/matrix-nginx-proxy/tasks/self_check_well_known_file.yml +++ b/roles/matrix-nginx-proxy/tasks/self_check_well_known_file.yml @@ -35,7 +35,7 @@ - name: Check .well-known on the identity hostname uri: url: "{{ well_known_url_identity }}" - follow_redirects: false + follow_redirects: "{{ well_known_file_check.follow_redirects }}" return_content: true register: result_well_known_identity ignore_errors: true