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

[bugfix] return early in websocket upgrade handler #1315

Conversation

NyaaaWhatsUpDoc
Copy link
Member

Fixes #1314

  • I/we have read the GoToSocial contribution guidelines.
  • I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
  • I/we have performed a self-review of added code.
  • I/we have written code that is legible and maintainable by others.
  • I/we have commented the added code, particularly in hard-to-understand areas.
  • I/we have run tests and they pass locally with the changes.
  • I/we have run go fmt ./... and golangci-lint run.

var token string

// First we check for a query param provided access token
if token = c.Query(AccessTokenQueryKey); token == "" {
Copy link
Contributor

Choose a reason for hiding this comment

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

i learn so much from reading your code kimbe, this little bit is just an example of that: it hadn't occurred to me to nest the checks like this, and also didn't think of using const to hint to the compiler like this

@tsmethurst
Copy link
Contributor

Looks good to me! Feel free to merge if you're happy with it :) Thanks for fixing my rather slapdash code :')

@NyaaaWhatsUpDoc NyaaaWhatsUpDoc merged commit 1bda6a2 into superseriousbusiness:main Jan 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug] Open websockets shouldn't count towards connection throttling limit
2 participants