mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-05 16:18:07 -06:00
Merge branch 'main' into add_gallery_web_rendering_mode
This commit is contained in:
commit
5822d451c7
214 changed files with 29471 additions and 4720 deletions
|
|
@ -640,6 +640,10 @@ nothanks.com`
|
|||
}
|
||||
]`
|
||||
jsonRespETag = "\"don't modify me daddy\""
|
||||
allowsResp = `people.we.like.com
|
||||
goodeggs.org
|
||||
allowthesefolks.church`
|
||||
allowsRespETag = "\"never change\""
|
||||
)
|
||||
|
||||
switch req.URL.String() {
|
||||
|
|
@ -720,6 +724,36 @@ nothanks.com`
|
|||
}
|
||||
responseContentLength = len(responseBytes)
|
||||
|
||||
case "https://lists.example.org/goodies.csv":
|
||||
extraHeaders = map[string]string{
|
||||
"Last-Modified": lastModified,
|
||||
"ETag": allowsRespETag,
|
||||
}
|
||||
if req.Header.Get("If-None-Match") == allowsRespETag {
|
||||
// Cached.
|
||||
responseCode = http.StatusNotModified
|
||||
} else {
|
||||
responseBytes = []byte(allowsResp)
|
||||
responseContentType = textCSV
|
||||
responseCode = http.StatusOK
|
||||
}
|
||||
responseContentLength = len(responseBytes)
|
||||
|
||||
case "https://lists.example.org/goodies":
|
||||
extraHeaders = map[string]string{
|
||||
"Last-Modified": lastModified,
|
||||
"ETag": allowsRespETag,
|
||||
}
|
||||
if req.Header.Get("If-None-Match") == allowsRespETag {
|
||||
// Cached.
|
||||
responseCode = http.StatusNotModified
|
||||
} else {
|
||||
responseBytes = []byte(allowsResp)
|
||||
responseContentType = textPlain
|
||||
responseCode = http.StatusOK
|
||||
}
|
||||
responseContentLength = len(responseBytes)
|
||||
|
||||
default:
|
||||
responseCode = http.StatusNotFound
|
||||
responseBytes = []byte(`{"error":"not found"}`)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue