-
Notifications
You must be signed in to change notification settings - Fork 68
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
Enable gosec
as a linter and resolve potential security issues
#1259
Conversation
Signed-off-by: Saswata Mukherjee <[email protected]>
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.
Just a small question about something I've seen in two places, otherwise LGTM.
Addr: o.Listen, | ||
Handler: handlers, | ||
ReadHeaderTimeout: 1 * time.Second, | ||
ReadTimeout: 5 * time.Second, |
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.
Is this a good value? Why is the write timeout so much bigger?
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.
Tbh, I copied this verbatim from obs API. I think the write timeout was bigger due to Loki stuff there.
Over here, I guess it will be remote write request to Obs API.
But yeah I can make both the same if you want.
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.
I'm mostly worried about the read timeout being so low than the write timeout being too big. Maybe we could bump the read timeout to something like 15s and the read header one to 5s? 🤔
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.
Done!
proxy/cmd/main.go
Outdated
Addr: cfg.listenAddress, | ||
Handler: handlers, | ||
ReadHeaderTimeout: 1 * time.Second, | ||
ReadTimeout: 5 * time.Second, |
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.
Same question about the big difference between read and write timeout.
Signed-off-by: Saswata Mukherjee <[email protected]>
Kudos, SonarCloud Quality Gate passed! |
/retest |
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: douglascamata, saswatamcode The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Enable
gosec
as linter and resolve certain potential security issues. Should also fix sonarcloud checks.