-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 Linting Errors #1835
Fix Linting Errors #1835
Conversation
Signed-off-by: andrewphamade@gmail.com <andrewphamade@gmail.com>
Signed-off-by: Andrew Hamade <andrewphamade@gmail.com>
Signed-off-by: Andrew Hamade <andrewphamade@gmail.com>
Signed-off-by: Andrew Hamade <andrewphamade@gmail.com>
Also fixes: #1646 |
When it says make a non master branch does it mean on my fork? |
Yes, typically we work from feature branches. There can sometimes be issues with the way our builds run if you PR from a branch called master, though I think they have been resolved now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quick question about one of the changes which looks like it could be a behaviour change, otherwise LGTM
@@ -186,7 +186,7 @@ func (s *server) Start(ctx context.Context) error { | |||
// When the given context is cancelled the server will be shutdown. | |||
// If any errors occur, only the first error will be returned. | |||
func (s *server) startServer(ctx context.Context, listener net.Listener) error { | |||
srv := &http.Server{Handler: s.handler} | |||
srv := &http.Server{Handler: s.handler, ReadHeaderTimeout: time.Minute} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where did this one come from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is to mitigate a potential slowloris attack. https://medium.com/a-journey-with-go/go-understand-and-mitigate-slowloris-attack-711c1b1403f6
I suppose we could make it configurable, but having this unset leaves the server vulnerable.
Signed-off-by: Andrew Hamade <andrewphamade@gmail.com>
Description
Fixed linting errors. I also found a possible slowloris error and fixed that as well:
https://github.com/devopstagon/oauth2-proxy/blob/master/pkg/http/server.go#L189
https://medium.com/a-journey-with-go/go-understand-and-mitigate-slowloris-attack-711c1b1403f6
Motivation and Context
I wanted to try and work on the Azure provider a bit, but I figured it would be a good idea to preemptively merge this into master first to have a "clean" base to work from.
How Has This Been Tested?
I ran make and also built an image and tested it in my environment.
Checklist: