diff --git a/fix.go b/fix.go new file mode 100644 index 0000000..4cf4bc2 --- /dev/null +++ b/fix.go @@ -0,0 +1,13 @@ +package fix + +// IsIdempotent checks if an HTTP method is safe to retry automatically. +// Non-idempotent methods (POST, PATCH) should not be retried without +// explicit user consent to prevent duplicate side effects. +func IsIdempotent(method string) bool { + switch method { + case "GET", "HEAD", "OPTIONS", "TRACE", "PUT", "DELETE": + return true + default: + return false + } +}