@@ -346,15 +346,15 @@ describe('Request tests', () => {
346346 expect ( result ) . toEqual ( mockResponse ) ;
347347 } ) ;
348348
349- it ( 'should use instance.request when URL length exceeds 2000 characters' , async ( ) => {
349+ it ( 'should use instance.request when URL length exceeds 8000 characters' , async ( ) => {
350350 const client = httpClient ( { defaultHostname : 'example.com' } ) ;
351351 const url = '/your-api-endpoint' ;
352352 const mockResponse = { data : 'mocked' } ;
353353
354- // Create a very long query parameter that will exceed 2000 characters when combined with baseURL
354+ // Create a very long query parameter that will exceed 8000 characters when combined with baseURL
355355 // baseURL is typically like 'https://example.com:443/v3' (~30 chars), url is '/your-api-endpoint' (~20 chars)
356- // So we need params that serialize to >1950 chars to exceed 2000 total
357- const longParam = 'x' . repeat ( 2000 ) ;
356+ // So we need params that serialize to >7950 chars to exceed 8000 total
357+ const longParam = 'x' . repeat ( 8000 ) ;
358358 const requestData = { params : { longParam, param2 : 'y' . repeat ( 500 ) } } ;
359359
360360 // Mock instance.request since that's what gets called for long URLs
@@ -498,15 +498,15 @@ describe('Request tests', () => {
498498 expect ( mock . history . get [ 0 ] . url ) . toBe ( absoluteUrl ) ;
499499 } ) ;
500500
501- it ( 'should handle absolute URL when actualFullUrl exceeds 2000 characters' , async ( ) => {
501+ it ( 'should handle absolute URL when actualFullUrl exceeds 8000 characters' , async ( ) => {
502502 const client = httpClient ( {
503503 defaultHostname : 'example.com' ,
504504 } ) ;
505505 const absoluteUrl = 'https://external-api.com/api/endpoint' ;
506506 const mockResponse = { data : 'mocked' } ;
507507
508- // Create a very long query parameter that will exceed 2000 characters
509- const longParam = 'x' . repeat ( 2000 ) ;
508+ // Create a very long query parameter that will exceed 8000 characters
509+ const longParam = 'x' . repeat ( 8000 ) ;
510510 const requestData = { params : { longParam, param2 : 'y' . repeat ( 500 ) } } ;
511511
512512 // Mock instance.request since that's what gets called for long URLs
@@ -542,8 +542,8 @@ describe('Request tests', () => {
542542 const absoluteUrl = 'https://external-api.com/api/endpoint' ;
543543 const mockResponse = { data : 'mocked' } ;
544544
545- // Create params that will make URL exceed 2000 characters
546- const longParam = 'x' . repeat ( 2000 ) ;
545+ // Create params that will make URL exceed 8000 characters
546+ const longParam = 'x' . repeat ( 8000 ) ;
547547 const requestData = { params : { longParam, param2 : 'y' . repeat ( 500 ) } } ;
548548
549549 // Mock instance.request since URL will exceed threshold
@@ -576,7 +576,7 @@ describe('Request tests', () => {
576576 } ;
577577
578578 // Create include[] parameters that would exceed 1500 chars for Live Preview
579- // but would be under 2000 chars for regular requests
579+ // but would be under 8000 chars for regular requests
580580 const manyIncludes = Array . from ( { length : 100 } , ( _ , i ) => `ref_field_${ i } _with_long_name` ) ;
581581 const requestData = { params : { 'include[]' : manyIncludes } } ;
582582
@@ -622,16 +622,16 @@ describe('Request tests', () => {
622622 expect ( mock . history . get . length ) . toBe ( 1 ) ;
623623 } ) ;
624624
625- it ( 'should use instance.request for regular URLs exceeding 2000 characters' , async ( ) => {
625+ it ( 'should use instance.request for regular URLs exceeding 8000 characters' , async ( ) => {
626626 const client = httpClient ( { defaultHostname : 'example.com' } ) ;
627627 const url = '/content_types/blog/entries/entry123' ;
628628 const mockResponse = { entry : { uid : 'entry123' , title : 'Test' } } ;
629629
630- // Create many include[] parameters that will exceed 2000 characters
631- const manyIncludes = Array . from ( { length : 200 } , ( _ , i ) => `ref_field_${ i } _with_very_long_name_to_make_url_long` ) ;
630+ // Create many include[] parameters that will exceed 8000 characters
631+ const manyIncludes = Array . from ( { length : 500 } , ( _ , i ) => `ref_field_${ i } _with_very_long_name_to_make_url_long` ) ;
632632 const requestData = { params : { 'include[]' : manyIncludes } } ;
633633
634- // Mock instance.request since URL will exceed 2000 chars
634+ // Mock instance.request since URL will exceed 8000 chars
635635 const requestSpy = jest . spyOn ( client , 'request' ) . mockResolvedValue ( { data : mockResponse } as any ) ;
636636
637637 const result = await getData ( client , url , requestData ) ;
0 commit comments