更新
This commit is contained in:
1 parent
5718a00e31
commit
1850ac640e
226 files changed
+37772
-12071
No files matched your search
@@ -116,11 +116,15 @@ func (c *TenantSiteController) resolveTemplateCode(tid uint64) string {
|
||||
return code
|
||||
}
|
||||
|
||||
// writeHTML 直出 HTML
|
||||
// writeHTML 直出 HTML。
|
||||
// 必须走 Output.Body:它会把 status 真正写进响应头并把 Output.Status 归零。
|
||||
// 用 Ctx.WriteString 直写 body 时状态码会滞留在 Output.Status 被丢弃(404/500 实返 200),
|
||||
// 且 beego 收尾还会用它再调一次 WriteHeader,触发 net/http 的 superfluous 告警。
|
||||
func (c *TenantSiteController) writeHTML(status int, html string) {
|
||||
body := []byte(c.rewriteStorageURLs(html))
|
||||
c.Ctx.Output.SetStatus(status)
|
||||
c.Ctx.Output.Header("Content-Type", "text/html; charset=utf-8")
|
||||
c.Ctx.WriteString(c.rewriteStorageURLs(html))
|
||||
_ = c.Ctx.Output.Body(body)
|
||||
}
|
||||
|
||||
var legacyQiniuDomains = []string{
|
||||
|
||||
Reference in new issue
Block a user