From c84ff6c0437ad374c911517172591dd344407962 Mon Sep 17 00:00:00 2001 From: SaAi <30327843+key1989han@users.noreply.github.com> Date: Tue, 4 Aug 2026 04:08:27 +0330 Subject: [PATCH] fix: Handle HTTP-date format in Retry-After header --- fix.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 fix.go 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 + } +}