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

Unused outer in setGetBody() #169

Closed
alex-schneider opened this issue Mar 29, 2021 · 0 comments · Fixed by #170
Closed

Unused outer in setGetBody() #169

alex-schneider opened this issue Mar 29, 2021 · 0 comments · Fixed by #170
Labels
bug Something isn't working

Comments

@alex-schneider
Copy link
Contributor

func (s *HTTPServer) setGetBody(h http.Handler, req *http.Request) error {
	outer := h
	if inner, protected := outer.(ac.ProtectedHandler); protected {
		outer = inner.Child()
	}

	if limitHandler, ok := h.(handler.EndpointLimit); ok {
		if err := eval.SetGetBody(req, limitHandler.RequestLimit()); err != nil {
			return err
		}
	}
	return nil
}

The var outer is unused.

The

if limitHandler, ok := h.(handler.EndpointLimit); ok {}

has to be changed to

if limitHandler, ok := outer.(handler.EndpointLimit); ok {}

@alex-schneider alex-schneider added the bug Something isn't working label Mar 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant