浏览代码

INSTALL: Fix setting content-type on well-known (#8793)

When using `add_header` nginx will literally add a header. If a
`content-type` header is already configured (for example through a
server wide default), this means we end up with 2 content-type headers,
like so:

```
content-type: text/html
content-type: application/json
access-control-allow-origin: *
```

That doesn't make sense. Instead, we want the content type of that
block to only be `application/json` which we can achieve using
`default_type` instead.

Signed-off-by: Daniele Sluijters <daenney@users.noreply.github.com>
tags/v1.24.0rc1
Daniele Sluijters 3 年前
committed by GitHub
父节点
当前提交
8ca120df7c
找不到此签名对应的密钥 GPG 密钥 ID: 4AEE18F83AFDEB23
共有 2 个文件被更改,包括 2 次插入1 次删除
  1. +1
    -1
      INSTALL.md
  2. +1
    -0
      changelog.d/8793.doc

+ 1
- 1
INSTALL.md 查看文件

@@ -487,7 +487,7 @@ In nginx this would be something like:
```
location /.well-known/matrix/client {
return 200 '{"m.homeserver": {"base_url": "https://<matrix.example.com>"}}';
add_header Content-Type application/json;
default_type application/json;
add_header Access-Control-Allow-Origin *;
}
```


+ 1
- 0
changelog.d/8793.doc 查看文件

@@ -0,0 +1 @@
Fix the example on how to set the `Content-Type` header in nginx for the Client Well-Known URI.

正在加载...
取消
保存