Skip to content

Commit

Permalink
GitLab: Fix post_gitlab_snippet headers
Browse files Browse the repository at this point in the history
This has been broken since 98df89e when it was changed to use
hub->http_post

Other than Content and Content_Type k:v pairs, hub->http_request()
presumes all other k:v pairs are headers.

By calling with with headers => { foo=> bar }, the actual arguments into
http_client->do_request() were

headers => { headers => { foo => bar } }
instead of
headers => { foo => bar }
  • Loading branch information
Davis-A authored and rjbs committed Jul 4, 2024
1 parent 9db9f4e commit 27584b5
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/Synergy/Reactor/GitLab.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1064,10 +1064,7 @@ async sub mr_report ($self, $who, $arg = {}) {
async sub post_gitlab_snippet ($self, $payload) {
my $res = await $self->hub->http_post(
$self->api_uri . '/v4/snippets',
headers => {
'PRIVATE-TOKEN' => $self->api_token,
},

'PRIVATE-TOKEN' => $self->api_token,
Content_Type => 'application/json',
Content => encode_json($payload),
);
Expand Down

0 comments on commit 27584b5

Please sign in to comment.