File tree Expand file tree Collapse file tree
browser-use-node/src/v2/resources
browser-use-python/src/browser_use_sdk/v2/resources Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,6 +19,9 @@ export class Browsers {
1919
2020 /** Create a new browser session. */
2121 create ( body : CreateBrowserBody = { } ) : Promise < BrowserSessionItemView > {
22+ if ( body . proxyCountryCode ) {
23+ body = { ...body , proxyCountryCode : body . proxyCountryCode . toLowerCase ( ) as any } ;
24+ }
2225 return this . http . post < BrowserSessionItemView > ( "/browsers" , body ) ;
2326 }
2427
Original file line number Diff line number Diff line change @@ -20,6 +20,9 @@ export class Sessions {
2020
2121 /** Create a new session. */
2222 create ( body ?: CreateSessionBody ) : Promise < SessionItemView > {
23+ if ( body ?. proxyCountryCode ) {
24+ body = { ...body , proxyCountryCode : body . proxyCountryCode . toLowerCase ( ) as any } ;
25+ }
2326 return this . http . post < SessionItemView > ( "/sessions" , body ) ;
2427 }
2528
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ def _build_create_body(
2727 if profile_id is not None :
2828 body ["profileId" ] = profile_id
2929 if proxy_country_code is not None :
30- body ["proxyCountryCode" ] = proxy_country_code
30+ body ["proxyCountryCode" ] = proxy_country_code . lower () if isinstance ( proxy_country_code , str ) else proxy_country_code
3131 if timeout is not None :
3232 body ["timeout" ] = timeout
3333 if browser_screen_width is not None :
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ def _build_create_body(
2929 if profile_id is not None :
3030 body ["profileId" ] = profile_id
3131 if proxy_country_code is not None :
32- body ["proxyCountryCode" ] = proxy_country_code
32+ body ["proxyCountryCode" ] = proxy_country_code . lower () if isinstance ( proxy_country_code , str ) else proxy_country_code
3333 if start_url is not None :
3434 body ["startUrl" ] = start_url
3535 if browser_screen_width is not None :
You can’t perform that action at this time.
0 commit comments