feat(plugins): add NoFollowRedirects option to HTTPRequest

Allow plugins to opt out of automatic redirect following on a per-request
basis. When set to true, the response returns the redirect status code and
Location header directly instead of following to the final destination.
This commit is contained in:
Deluan
2026-03-20 18:16:07 -04:00
parent 5cd1fcb492
commit 03844a9a36
6 changed files with 54 additions and 15 deletions
+6 -5
View File
@@ -4,11 +4,12 @@ import "context"
// HTTPRequest represents an outbound HTTP request from a plugin.
type HTTPRequest struct {
Method string `json:"method"`
URL string `json:"url"`
Headers map[string]string `json:"headers,omitempty"`
Body []byte `json:"body,omitempty"`
TimeoutMs int32 `json:"timeoutMs,omitempty"`
Method string `json:"method"`
URL string `json:"url"`
Headers map[string]string `json:"headers,omitempty"`
NoFollowRedirects bool `json:"noFollowRedirects,omitempty"`
Body []byte `json:"body,omitempty"`
TimeoutMs int32 `json:"timeoutMs,omitempty"`
}
// HTTPResponse represents the response from an outbound HTTP request.