This commit is contained in:
jay brown
2025-03-28 13:44:05 -07:00
parent fdb6bbccf6
commit 2e301db851
+7 -2
View File
@@ -207,9 +207,14 @@ func TestGetDebugMiddleware(t *testing.T) {
// Check URL info was logged // Check URL info was logged
if urlInfo, ok := details["url"].(map[string]interface{}); ok { if urlInfo, ok := details["url"].(map[string]interface{}); ok {
assert.Contains(t, urlInfo["full"].(string), "/example") // Safely assert types before using Contains
if fullURL, ok := urlInfo["full"].(string); ok {
assert.Contains(t, fullURL, "/example")
}
assert.Equal(t, "/example", urlInfo["path"]) assert.Equal(t, "/example", urlInfo["path"])
assert.Contains(t, urlInfo["query"].(string), "param=value") if query, ok := urlInfo["query"].(string); ok {
assert.Contains(t, query, "param=value")
}
} }
// Check headers were logged // Check headers were logged