fix token request (GET not POST)

This commit is contained in:
2023-08-18 21:44:49 -07:00
parent f65905c9bd
commit 06b2ca9b74
6 changed files with 7 additions and 94 deletions

View File

@@ -3,7 +3,6 @@ const core = require('@actions/core');
const http = require('http');
const https = require('https');
const querystring = require('querystring');
const form_urlencoded = require('form-urlencoded');
const req_timeout_ms = 30_000;
const manifest_media_type = 'application/vnd.docker.distribution.manifest.v2+json';
@@ -98,9 +97,9 @@ async function get_token(www_authenticate, input) {
password: input.password,
};
const { status, headers, body } = await http_req('POST', params.realm, {
const { status, headers, body } = await http_req('GET', params.realm + '?' + querystring.stringify(query_params), {
'content-type': 'application/x-www-form-urlencoded',
}, form_urlencoded(query_params));
});
if (status !== 200) {
console.error('get token response', { status, headers, body });