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

Allow empty body in POST /commit again #45550

Merged
merged 2 commits into from
May 18, 2023

Commits on May 17, 2023

  1. client: don't marshal typed nils in request body

    The internal Client request methods which accept an object as a body use
    nil to signal that the request should not have a body. But it is easy to
    accidentally pass a typed-nil value as the object, e.g. if the object
    comes from a function argument or struct field of a concrete type. The
    result is that these requests will, surprisingly, have a JSON body of
    `null`. Treat typed-nil pointers the same as untyped nils for the
    purposes of determining whether or not the request should include a
    body.
    
    Stop assuming that POST requests should always have a body. POST /commit
    does not require a body, for example.
    
    Signed-off-by: Cory Snider <csnider@mirantis.com>
    corhere committed May 17, 2023
    Configuration menu
    Copy the full SHA
    3ceb381 View commit details
    Browse the repository at this point in the history
  2. api/server: allow empty body for POST /commit again

    The error returned by DecodeConfig was changed in
    b6d58d7 and caused this to regress.
    Allow empty request bodies for this endpoint once again.
    
    Signed-off-by: Cory Snider <csnider@mirantis.com>
    corhere committed May 17, 2023
    Configuration menu
    Copy the full SHA
    967c7bc View commit details
    Browse the repository at this point in the history