@@ -26,7 +26,7 @@ public class Chatbot {
2626 private String cfClearance ;
2727 private String userAgent ;
2828 private String parentId ;
29- private Map <String , String > headers ;
29+ private Map <String , String > headers = new HashMap <>() ;
3030
3131 private String conversationIdPrev ;
3232 private String parentIdPrev ;
@@ -260,12 +260,15 @@ public void refreshSession() {
260260 // Set cookies
261261 session .getCookies ().put ("__Secure-next-auth.session-token" , sessionToken );
262262 session .getCookies ().put ("cf_clearance" , cfClearance );
263+ Map <String , String > map = new HashMap <>();
264+ map .put ("User-Agent" , userAgent );
265+ session .setHeaders (map );
263266
264267 String urlSession = "https://chat.openai.com/api/auth/session" ;
265- HttpResponse response = session .get2 (urlSession ,
266- Collections . singletonMap ( "User-Agent" , userAgent ));
268+ HttpResponse response = session .get2 (urlSession );
269+
267270 if (response .getStatus () != 200 ) {
268- System .out .println ("err code: " + response .getStatus ());
271+ System .err .println ("err code: " + response .getStatus ());
269272 System .out .println ("cf_clearance: " + cfClearance );
270273 System .out .println ("token: " + sessionToken );
271274 System .out .println ("userAgent: " + userAgent );
0 commit comments