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: Allow HTTP POST for PATCH RPCs #1262

Merged
merged 2 commits into from
Mar 7, 2023
Merged

fix: Allow HTTP POST for PATCH RPCs #1262

merged 2 commits into from
Mar 7, 2023

Conversation

lqiu96
Copy link
Contributor

@lqiu96 lqiu96 commented Mar 3, 2023

Fixes #1261

Adding a conditional to generate an additional handler for PATCH requests:
i.e.

	router.HandleFunc("/v1beta1/repeat:bodypatch", rest.HandleRepeatDataBodyPatch).Methods("PATCH")
	router.HandleFunc("/v1beta1/repeat:bodypatch", rest.HandleRepeatDataBodyPatch).HeadersRegexp("X-HTTP-Method-Override", "^PATCH$").Methods("POST")

The second handler function matches specifically for Java's use case. It must match both conditions:

  • Header- X-HTTP-Method-Override: PATCH
  • Http Verb: POST

@lqiu96 lqiu96 requested a review from a team as a code owner March 3, 2023 19:00
@lqiu96
Copy link
Contributor Author

lqiu96 commented Mar 6, 2023

@noahdietz @vchudnov-g Would you be able to review this PR?

@noahdietz
Copy link
Collaborator

We will merge this and then a regeneration PR will open up with all of the changes. I will approve that so that it is included in the release, then we can cut a release for you to use.

@noahdietz noahdietz merged commit 4070ce3 into main Mar 7, 2023
@noahdietz noahdietz deleted the main-rest_patch_rpcs branch March 7, 2023 17:35
gcf-merge-on-green bot pushed a commit that referenced this pull request Mar 7, 2023
🤖 I have created a release *beep* *boop*
---


## [0.26.0](https://togithub.com/googleapis/gapic-showcase/compare/v0.25.0...v0.26.0) (2023-03-07)


### Features

* **go:** Update Go version to 1.19 ([#1225](https://togithub.com/googleapis/gapic-showcase/issues/1225)) ([d4b108e](https://togithub.com/googleapis/gapic-showcase/commit/d4b108e16dc91c0ea6d4dec3dca4d3270d3bf47a))


### Bug Fixes

* Build assets for darwin/arm64 ([#1267](https://togithub.com/googleapis/gapic-showcase/issues/1267)) ([0833a57](https://togithub.com/googleapis/gapic-showcase/commit/0833a579131c14582b053f26698fdfe93e465d87))
* Export showcase_v1beta1.yaml from BUILD.bazel to support external GAPIC generation ([#1223](https://togithub.com/googleapis/gapic-showcase/issues/1223)) ([5076348](https://togithub.com/googleapis/gapic-showcase/commit/507634898e208b7ff88784e4ec5f0efd22bff9ab))
* Handle x-http-method-override for PATCH as POST ([#1262](https://togithub.com/googleapis/gapic-showcase/issues/1262)) ([4070ce3](https://togithub.com/googleapis/gapic-showcase/commit/4070ce331bd5e852ccb2f4f2267dce80a9dda9c4))
* Use quotes around extreme int64 values ([#1206](https://togithub.com/googleapis/gapic-showcase/issues/1206)) ([c9d9ff1](https://togithub.com/googleapis/gapic-showcase/commit/c9d9ff191bfd72fe8563625be4074fe4659585d6)), closes [#1205](https://togithub.com/googleapis/gapic-showcase/issues/1205)

---
This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
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.

Allow HTTP POST calls for any showcase PATCH RPCs
2 participants