fix token request (GET not POST)
This commit is contained in:
5
index.js
5
index.js
@@ -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 });
|
||||
|
||||
Reference in New Issue
Block a user