Skip to content
This repository was archived by the owner on Dec 16, 2025. It is now read-only.

fix: http2: serialize array parameters correctly#492

Merged
bcoe merged 2 commits intogoogleapis:mainfrom
harris-m:main
Dec 1, 2022
Merged

fix: http2: serialize array parameters correctly#492
bcoe merged 2 commits intogoogleapis:mainfrom
harris-m:main

Conversation

@harris-m
Copy link
Copy Markdown
Contributor

@harris-m harris-m commented Nov 9, 2022

Partially fixes googleapis/google-cloud-node-core#775 (the "wrong queryParameters serialization" part)

I noticed that a parameter with type string[] in the Google Calendar API was not working as expecting while using google.options({ http2: true });. Specifically I was trying to use:

google.options({ http2: true });
google
  .calendar({
    version: "v3",
    auth: new google.auth.OAuth2(...),
  })
  .events.list({
    calendarId: ...,
    privateExtendedProperty: [`foo=bar`, `baz=asdf`],
  });

I found that the privateExtendedProperty parameter was being ignored by the server.

I traced the issue to this line. Unlike the gaxios request handler (reference), the http2 handler is not calling the paramsSerializer from the parameters. This function is used to define the correct serialization method for array parameters in apirequest.ts (reference).

My fix uses the paramsSerializer passed in from the parameters exactly as is done in gaxios.

@harris-m harris-m requested a review from a team November 9, 2022 02:28
@google-cla
Copy link
Copy Markdown

google-cla Bot commented Nov 9, 2022

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

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@product-auto-label product-auto-label Bot added the size: xs Pull request size is extra small. label Nov 9, 2022
@danielbankhead danielbankhead added kokoro:run Add this label to force Kokoro to re-run the tests. owlbot:run Add this label to trigger the Owlbot post processor. labels Nov 29, 2022
@gcf-owl-bot gcf-owl-bot Bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Nov 29, 2022
@yoshi-kokoro yoshi-kokoro removed the kokoro:run Add this label to force Kokoro to re-run the tests. label Nov 29, 2022
@bcoe bcoe merged commit f4c36b8 into googleapis:main Dec 1, 2022
@bcoe
Copy link
Copy Markdown

bcoe commented Dec 1, 2022

@harris-m thank you for the contribution.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

size: xs Pull request size is extra small.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

http2 POST requests deadlock, wrong queryParameters serialization

4 participants