use buffer for content
This commit is contained in:
parent
efaa2aa24d
commit
4ec5cfd721
5
dist/index.js
vendored
5
dist/index.js
vendored
@ -2945,9 +2945,10 @@ async function get_manifest(input) {
|
||||
|
||||
async function put_manifest(new_tag, manifest, input) {
|
||||
const path = `/v2/${input.manifest.image}/manifests/${new_tag}`;
|
||||
const content = Buffer.from(manifest, 'utf8');
|
||||
const req_headers = {
|
||||
'content-type': manifest_media_type,
|
||||
'content-length': Buffer.byteLength(manifest),
|
||||
'content-length': content.byteLength,
|
||||
};
|
||||
|
||||
http_basic_auth(req_headers, input);
|
||||
@ -2956,7 +2957,7 @@ async function put_manifest(new_tag, manifest, input) {
|
||||
// req_headers.authorization = `Bearer ${input.token}`;
|
||||
// }
|
||||
|
||||
const { status, headers, body } = await http_req('PUT', input.registry_url + path, req_headers, manifest);
|
||||
const { status, headers, body } = await http_req('PUT', input.registry_url + path, req_headers, content);
|
||||
|
||||
if (status >= 400) {
|
||||
console.error('put manifest response', { status, headers, body });
|
||||
|
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
5
index.js
5
index.js
@ -84,9 +84,10 @@ async function get_manifest(input) {
|
||||
|
||||
async function put_manifest(new_tag, manifest, input) {
|
||||
const path = `/v2/${input.manifest.image}/manifests/${new_tag}`;
|
||||
const content = Buffer.from(manifest, 'utf8');
|
||||
const req_headers = {
|
||||
'content-type': manifest_media_type,
|
||||
'content-length': Buffer.byteLength(manifest),
|
||||
'content-length': content.byteLength,
|
||||
};
|
||||
|
||||
http_basic_auth(req_headers, input);
|
||||
@ -95,7 +96,7 @@ async function put_manifest(new_tag, manifest, input) {
|
||||
// req_headers.authorization = `Bearer ${input.token}`;
|
||||
// }
|
||||
|
||||
const { status, headers, body } = await http_req('PUT', input.registry_url + path, req_headers, manifest);
|
||||
const { status, headers, body } = await http_req('PUT', input.registry_url + path, req_headers, content);
|
||||
|
||||
if (status >= 400) {
|
||||
console.error('put manifest response', { status, headers, body });
|
||||
|
Loading…
x
Reference in New Issue
Block a user