@@ -49,9 +49,13 @@ wrap(fetchBlockedLists, "fetchBlockedLists", function fetchBlockedLists() {
4949 key : "google_extended" ,
5050 pattern : "Google-Extended" ,
5151 } ,
52+ {
53+ key : "chatgpt_agent" ,
54+ pattern : "chatgpt.com" ,
55+ } ,
5256 ] ,
5357 blockedSignatureAgents : "" ,
54- monitoredSignatureAgents : "" ,
58+ monitoredSignatureAgents : "chatgpt.com " ,
5559 } satisfies Response ;
5660 } ;
5761} ) ;
@@ -97,17 +101,28 @@ t.test("it tracks monitored user agents", async () => {
97101 } ,
98102 timeoutInMS : 500 ,
99103 } ) ,
100- ] ) . then ( ( [ response1 , response2 , response3 ] ) => {
104+ fetch ( {
105+ url : new URL ( "http://localhost:3327/test" ) ,
106+ method : "GET" ,
107+ headers : {
108+ "Signature-Agent" : "chatgpt.com" ,
109+ } ,
110+ timeoutInMS : 500 ,
111+ } ) ,
112+ ] ) . then ( ( [ response1 , response2 , response3 , response4 ] ) => {
101113 t . equal ( response1 . statusCode , 200 ) ;
102114 t . equal ( response2 . statusCode , 200 ) ;
103115 t . equal ( response3 . statusCode , 200 ) ;
116+ t . equal ( response4 . statusCode , 200 ) ;
104117 const stats = agent . getInspectionStatistics ( ) . getStats ( ) ;
105118 t . same ( stats . userAgents , {
106119 breakdown : {
107120 // eslint-disable-next-line camelcase
108121 ai_data_scrapers : 1 ,
109122 // eslint-disable-next-line camelcase
110123 google_extended : 1 ,
124+ // eslint-disable-next-line camelcase
125+ chatgpt_agent : 1 ,
111126 } ,
112127 } ) ;
113128 t . same ( stats . ipAddresses , {
0 commit comments