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: set mediaType to null if contentType cannot be parsed #911

Merged
merged 2 commits into from Dec 10, 2019

Conversation

jmorrise
Copy link
Contributor

Fixes issue #905 by setting mediaType to null if the contentType is invalid.

@jmorrise jmorrise requested a review from a team as a code owner December 10, 2019 20:09
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Dec 10, 2019
Avoids users hitting a runtime exception when the contentType is
invalid.
@jmorrise
Copy link
Contributor Author

I force-pushed to resolve the conventionalcommits error, but I'm afraid things might be in a weird state now - let me know if I need to fix this.

@chingor13 chingor13 changed the title Set mediaType to null if contentType cannot be parsed. fix: set mediaType to null if contentType cannot be parsed. Dec 10, 2019
@chingor13 chingor13 changed the title fix: set mediaType to null if contentType cannot be parsed. fix: set mediaType to null if contentType cannot be parsed Dec 10, 2019
@chingor13 chingor13 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 10, 2019
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 10, 2019
@chingor13
Copy link
Collaborator

Note that this is potentially a behavior breaking change in that previously you could get an InvalidArgumentException (unchecked, runtime exception) when executing a request. Now, you will get the response with a null (unparsed) MediaType which would seem to be always preferred anyways.

@chingor13 chingor13 merged commit 7ea53eb into googleapis:master Dec 10, 2019
Copy link
Contributor

@elharo elharo left a comment

Choose a reason for hiding this comment

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

There might be an argument for defaulting to application/octet-stream instead of null.

clundin25 pushed a commit to clundin25/google-http-java-client that referenced this pull request Aug 11, 2022
…ent-bom to v1.41.7 (googleapis#911)

[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.http-client:google-http-client-bom](https://togithub.com/googleapis/google-http-java-client) | `1.41.6` -> `1.41.7` | [![age](https://badges.renovateapi.com/packages/maven/com.google.http-client:google-http-client-bom/1.41.7/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.http-client:google-http-client-bom/1.41.7/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.http-client:google-http-client-bom/1.41.7/compatibility-slim/1.41.6)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.http-client:google-http-client-bom/1.41.7/confidence-slim/1.41.6)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>googleapis/google-http-java-client</summary>

### [`v1.41.7`](https://togithub.com/googleapis/google-http-java-client/blob/HEAD/CHANGELOG.md#&#8203;1417-httpsgithubcomgoogleapisgoogle-http-java-clientcomparev1416v1417-2022-04-11)

[Compare Source](https://togithub.com/googleapis/google-http-java-client/compare/v1.41.6...v1.41.7)

</details>

---

### Configuration

📅 **Schedule**: At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/google-auth-library-java).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants