GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: use random UUID for multipart boundary delimiter by dmitry-fa · Pull Request #916 · googleapis/google-http-java-client

Conversation

@dmitry-fa

@dmitry-fa dmitry-fa commented Dec 16, 2019 •
edited by chingor13
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Fixes #909
Fixes googleapis/google-cloud-java#6386

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@dmitry-fa
dmitry-fa requested a review from a team December 16, 2019 07:47
@googlebot

googlebot commented Dec 16, 2019

Copy link
Copy Markdown

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
  • It's possible we don't have your GitHub username or you're using a different email address on your commit. Check your existing CLA data and verify that your email is set on your git commits.
Corporate signers
  • Your company has a Point of Contact who decides which employees are authorized to participate. Ask your POC to be added to the group of authorized contributors. If you don't know who your Point of Contact is, direct the Google project maintainer to go/cla#troubleshoot (Public version).
  • The email used to register you as an authorized contributor must be the email used for the Git commit. Check your existing CLA data and verify that your email is set on your git commits.
  • The email used to register you as an authorized contributor must also be attached to your GitHub account.

ℹ️ Googlers: Go here for more info.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@googlebot googlebot added the cla: no This human has *not* signed the Contributor License Agreement. label Dec 16, 2019
@dmitry-fa
dmitry-fa force-pushed the df67450/google-http-java-client branch from d4b8f7d to 787b159 Compare December 16, 2019 08:16
@googlebot

googlebot commented Dec 16, 2019

Copy link
Copy Markdown

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@googlebot googlebot added cla: yes This human has signed the Contributor License Agreement. and removed cla: no This human has *not* signed the Contributor License Agreement. labels Dec 16, 2019
@dmitry-fa
fix: use random uuid string as boundary
9971579
@dmitry-fa
dmitry-fa force-pushed the df67450/google-http-java-client branch from 787b159 to 9971579 Compare December 16, 2019 08:23
@athakor athakor added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 16, 2019
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 16, 2019
@dmitry-fa dmitry-fa changed the title Fixes #909 Use random UUID string as boundary instead of hardcoded '__END_OF_PART__' Fixes #909 and closes googleapis/google-cloud-java/#6386 Dec 16, 2019
@dmitry-fa dmitry-fa changed the title Fixes #909 and closes googleapis/google-cloud-java/#6386 Fixes #909 and closes googleapis/google-cloud-java#6386 Dec 16, 2019
elharo
elharo reviewed Dec 30, 2019
View reviewed changes
Comment thread google-http-client/src/main/java/com/google/api/client/http/MultipartContent.java Outdated

public MultipartContent() {
super(new HttpMediaType("multipart/related").setParameter("boundary", "__END_OF_PART__"));
this("__END_OF_PART__" + java.util.UUID.randomUUID().toString() + "__");

@elharo elharo Dec 30, 2019

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Is there a reason not to import java.util.UUID? e.g a conflict with a similarly named class?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@dmitry-fa dmitry-fa Dec 30, 2019

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

fixed.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread google-http-client/src/test/java/com/google/api/client/http/MultipartContentTest.java Outdated
{"<xml>Hi</xml>", "application/xml"},
{"{x:1,y:2}", "application/json"}
};
StringBuilder expectedContentSB = new StringBuilder();

@elharo elharo Dec 30, 2019

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

no abbreviations per google style, but simply "expectedContent" or even just expected is fine.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@dmitry-fa dmitry-fa Dec 30, 2019

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

expectedContent is used later. renamed to expectedStringBuilder

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread google-http-client/src/test/java/com/google/api/client/http/MultipartContentTest.java Outdated
ByteArrayOutputStream out = new ByteArrayOutputStream();
content.writeTo(out);
String expectedContent = expectedContentSB.toString();
assertEquals(expectedContent, out.toString());

@elharo elharo Dec 30, 2019

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

out.toString needs to specify a locale

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@dmitry-fa dmitry-fa Dec 30, 2019

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

fixed in two places. Thanks for catching that.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@dmitry-fa
fix: use random uuid string as boundary
5d8300b
@chingor13 chingor13 changed the title Fixes #909 and closes googleapis/google-cloud-java#6386 fix: use random UUID for multipart boundary delimiter Dec 30, 2019
@chingor13 chingor13 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 30, 2019
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 30, 2019
elharo
elharo approved these changes Dec 30, 2019
View reviewed changes
@chingor13
chingor13 merged commit 91c20a3 into googleapis:master Dec 30, 2019
@dmitry-fa
dmitry-fa deleted the df67450/google-http-java-client branch January 15, 2020 09:55
clundin25 pushed a commit to clundin25/google-http-java-client that referenced this pull request Aug 11, 2022
@renovate-bot
chore(deps): update dependency org.sonatype.plugins:nexus-staging-mav…
112bfc9
…en-plugin to v1.6.13 (googleapis#916)

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

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [org.sonatype.plugins:nexus-staging-maven-plugin](http://www.sonatype.com/) ([source](https://togithub.com/sonatype/nexus-maven-plugins)) | `1.6.12` -> `1.6.13` | [![age](https://badges.renovateapi.com/packages/maven/org.sonatype.plugins:nexus-staging-maven-plugin/1.6.13/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.sonatype.plugins:nexus-staging-maven-plugin/1.6.13/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.sonatype.plugins:nexus-staging-maven-plugin/1.6.13/compatibility-slim/1.6.12)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.sonatype.plugins:nexus-staging-maven-plugin/1.6.13/confidence-slim/1.6.12)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>sonatype/nexus-maven-plugins</summary>

### [`v1.6.13`](https://togithub.com/sonatype/nexus-maven-plugins/compare/release-1.6.12...release-1.6.13)

[Compare Source](https://togithub.com/sonatype/nexus-maven-plugins/compare/release-1.6.12...release-1.6.13)

</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

Reviewers

1 more reviewer
@elharo elharo elharo approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

MultipartContent class uses the same simple string as the default boundary CRC error when uploading a specific content to Google cloud storage

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@dmitry-fa @googlebot @elharo @chingor13 @kokoro-team @athakor
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.