Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] use unrestricted http client only for non-safe requests #3847

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

abmussani
Copy link
Contributor

Description:

PR #3841 removes all the safety majors on OpsGenie Analyzer. This PR use unrestricted http client only for non-safe operations. Other than that restricted one will be used as usual.

Checklist:

  • Tests passing (make test-community)?
  • Lint passing (make lint this requires golangci-lint)?

Use Restricted Client for non-safe APIs.
@abmussani abmussani requested a review from a team January 21, 2025 06:45
@abmussani abmussani self-assigned this Jan 21, 2025
@abmussani abmussani requested a review from a team as a code owner January 21, 2025 06:45
@@ -126,7 +126,7 @@ func (r AnalyzerRoundTripper) RoundTrip(req *http.Request) (*http.Response, erro

// methodIsSafe is a helper method to check whether the HTTP method is safe according to MDN Web Docs.
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods#safe_idempotent_and_cacheable_request_methods
func methodIsSafe(method string) bool {
func MethodIsSafe(method string) bool {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: If we rename this to IsMethodSafe, it might read more clearly at the call site as a bool check. Otherwise, it could give the impression that we’re trying to convert the method into a safe one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants