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 incorrect client hash #212

Merged
merged 1 commit into from Jan 31, 2024
Merged

Fix incorrect client hash #212

merged 1 commit into from Jan 31, 2024

Conversation

smoogipoo
Copy link
Contributor

@smoogipoo smoogipoo commented Jan 30, 2024

The client will eventually send the correct hash as it does for osu-web, for this server too.

// The token is 82 chars long, and the clientHash is the first 32 of those.
// See: https://github.com/ppy/osu-web/blob/7be19a0fe0c9fa2f686e4bb686dbc8e9bf7bcf84/app/Libraries/ClientCheck.php#L92
if (versionHash?.Length >= 82)
versionHash = versionHash.Substring(versionHash.Length - 82, 32);
Copy link
Collaborator

Choose a reason for hiding this comment

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

What's with the subtraction? If the client hash is the first 32 chars of this, then why is the first argument not... just 0?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The 82-length portion is actually at the end of a much longer string.

Actually now that I mention it, I should probably make sure this is only sent on the first request otherwise this is quite a lot of data to send in a realtime system.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should be fine so long as SignalR doesn't fallback to one of the polling transports. If it does we can fix that when we come to it.

Copy link
Collaborator

@bdach bdach left a comment

Choose a reason for hiding this comment

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

From a code perspective seems fine, but this should probably be reviewed by someone with access.

@bdach bdach requested a review from peppy January 30, 2024 15:23
@peppy peppy merged commit 98eb8d3 into ppy:master Jan 31, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants