diff options
| author | 2025-03-19 12:06:50 +0100 | |
|---|---|---|
| committer | 2025-03-20 14:13:23 +0100 | |
| commit | b6e56feeda457779db0a96b4a7b393f96a040859 (patch) | |
| tree | 2883feb81a487879f15424822c5ee098308f1fd7 /testrig | |
| parent | [bugfix] Avoid nil ptr if maintenance router can't be started (#3919) (diff) | |
| download | gotosocial-0.18.3.tar.xz | |
[bugfix] Fix set obfuscate = null error in adoptPerm (#3922)v0.18.3
* [chore] More tests for domain allow + block subscriptions
* [bugfix] Fix set `obfuscate = null` error in adoptPerm
* fmt
Diffstat (limited to 'testrig')
| -rw-r--r-- | testrig/transportcontroller.go | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/testrig/transportcontroller.go b/testrig/transportcontroller.go index 00f8ad2a6..156049caa 100644 --- a/testrig/transportcontroller.go +++ b/testrig/transportcontroller.go @@ -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"}`) |
