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 push URLs to match the spec. #986

Merged
merged 2 commits into from
Dec 4, 2020
Merged

Fix push URLs to match the spec. #986

merged 2 commits into from
Dec 4, 2020

Conversation

clokep
Copy link
Member

@clokep clokep commented Dec 2, 2020

This matches matrix-org/synapse#8865 to ensure the push URLs match the spec.

@clokep clokep requested a review from a team December 2, 2020 20:50
Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

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

in principle this looks good, but it seems like there are more instances of non-compliance.

@clokep
Copy link
Member Author

clokep commented Dec 3, 2020

Sorry about that! I thought I caught all the instances. 😢

@clokep clokep requested a review from a team December 3, 2020 18:05
Comment on lines +28 to 43
await_http_request( $PUSH_LOCATION, sub {
my ( $request ) = @_;
my $body = $request->body_from_json;

# Respond to all requests, even if we filter them out
$request->respond_json( $response // {} );

return unless $body->{notification}{type};
return unless $body->{notification}{type} eq "m.room.message";

# Ensure this is the expected pusher.
return unless $body->{notification}{devices};
return unless $body->{notification}{devices}[0]{pushkey} eq $pushkey;

# Respond to expected request.
$request->respond_json( $response // {} );

return 1;
});
Copy link
Member Author

Choose a reason for hiding this comment

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

This is attempting to check one of the fields of the request instead of differentiating on URL.

@clokep clokep merged commit fd84283 into develop Dec 4, 2020
@clokep clokep deleted the clokep/pusher-url branch December 4, 2020 14:56
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.

3 participants