File tree 1 file changed +14
-8
lines changed
1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,7 @@ const {
103
103
ALERT_TYPE_MEDIUM_CVE ,
104
104
ALERT_TYPE_MILD_CVE ,
105
105
ALERT_TYPE_SOCKET_UPGRADE_AVAILABLE ,
106
+ API_V0_URL ,
106
107
CVE_ALERT_PROPS_FIRST_PATCHED_VERSION_IDENTIFIER ,
107
108
CVE_ALERT_PROPS_VULNERABLE_VERSION_RANGE ,
108
109
abortSignal
@@ -113,15 +114,20 @@ async function* createBatchGenerator(
113
114
) : AsyncGenerator < CompactSocketArtifact > {
114
115
// Adds the first 'abort' listener to abortSignal.
115
116
const req = https
116
- // Lazily access constants.BATCH_PURL_ENDPOINT.
117
- . request ( constants . BATCH_PURL_ENDPOINT , {
118
- method : 'POST' ,
119
- headers : {
120
- Authorization : `Basic ${ btoa ( `${ getPublicToken ( ) } :` ) } `
117
+ . request (
118
+ `${ API_V0_URL } purl?${ new URLSearchParams ( [
119
+ [ 'alerts' , 'true' ] ,
120
+ [ 'compact' , 'true' ]
121
+ ] ) } `,
122
+ {
123
+ method : 'POST' ,
124
+ headers : {
125
+ Authorization : `Basic ${ btoa ( `${ getPublicToken ( ) } :` ) } `
126
+ }
127
+ // TODO: Fix to not abort process on network abort.
128
+ // signal: abortSignal
121
129
}
122
- // TODO: Fix to not abort process on network abort.
123
- // signal: abortSignal
124
- } )
130
+ )
125
131
. end (
126
132
JSON . stringify ( {
127
133
components : chunk . map ( id => ( { purl : `pkg:npm/${ id } ` } ) )
You can’t perform that action at this time.
0 commit comments