Skip to content

Set default make_http_request body to nil

John McDonnell requested to merge jmd/set-params-for-http-nil-by-default into master

What does this MR do and why?

Followup from !1243 (comment 1675714217)

While the HTTP spec does allow a GET request contain a body, the semantics of such requests are undefined. Therefore it is often considered best practice to not include a payload on a GET request.

This has caused issues in the past such as this failure where dockerhub began to return errors with a payload of "{}" but worked with nil. gitlab#433330 (closed)

To avoid any other such unexpected failures on GET requests, let's instead assume that by default the GET request will have a nil payload and allow a caller to pass the payload when required.

How to set up and validate locally

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by John McDonnell

Merge request reports