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

Google Cloud Pub/Sub: require JSON responses #2217

Merged
merged 2 commits into from
Mar 18, 2020

Conversation

ennru
Copy link
Member

@ennru ennru commented Mar 18, 2020

Guard the HTTP response to be JSON before trying to deserialize it so that missing subscriptions aren't reported as marshalling problems.

References #1840

@@ -164,7 +164,7 @@ private[pubsub] trait PubSubApi {
.mapAsync(1) {
case Success(response) =>
response.status match {
case StatusCodes.Success(_) =>
case StatusCodes.Success(_) if response.entity.contentType == ContentTypes.`application/json` =>
Copy link
Member

Choose a reason for hiding this comment

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

Maybe also include the contentType in the "Unexpected response" exception below, to help debugging when the response is rejected because the content-type is wrong?

@ennru ennru merged commit 7fce3b3 into akka:master Mar 18, 2020
@ennru ennru deleted the google-pub-sub-json branch March 18, 2020 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants