From cecb1fd00955ab8670d3099f016eeaa5af663dc5 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Wed, 19 Mar 2025 12:06:50 +0100 Subject: [bugfix] Fix set obfuscate = null error in adoptPerm (#3922) * [chore] More tests for domain allow + block subscriptions * [bugfix] Fix set `obfuscate = null` error in adoptPerm * fmt --- testrig/transportcontroller.go | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'testrig') diff --git a/testrig/transportcontroller.go b/testrig/transportcontroller.go index a6b0dd801..bbcb3901d 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"}`) -- cgit v1.2.3