Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions fix.go
Original file line number Diff line number Diff line change
@@ -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
}
}