feat(core,storage,oci,registry-config): add streaming response support and configurable registry URLs across protocols
This commit is contained in:
@@ -302,9 +302,9 @@ export class ComposerRegistry extends BaseRegistry {
|
||||
token: IAuthToken | null
|
||||
): Promise<IResponse> {
|
||||
// Read operations are public, no authentication required
|
||||
const zipData = await this.storage.getComposerPackageZip(vendorPackage, reference);
|
||||
const streamResult = await this.storage.getComposerPackageZipStream(vendorPackage, reference);
|
||||
|
||||
if (!zipData) {
|
||||
if (!streamResult) {
|
||||
return {
|
||||
status: 404,
|
||||
headers: {},
|
||||
@@ -316,10 +316,10 @@ export class ComposerRegistry extends BaseRegistry {
|
||||
status: 200,
|
||||
headers: {
|
||||
'Content-Type': 'application/zip',
|
||||
'Content-Length': zipData.length.toString(),
|
||||
'Content-Length': streamResult.size.toString(),
|
||||
'Content-Disposition': `attachment; filename="${reference}.zip"`,
|
||||
},
|
||||
body: zipData,
|
||||
body: streamResult.stream,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user