File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,9 +42,17 @@ SteamStore.prototype.setCookie = function(cookie) {
4242 this . steamID = new SteamID ( cookie . match ( / = ( \d + ) / ) [ 1 ] ) ;
4343 }
4444
45+ let requestCookie = Request . cookie ( cookie ) ;
46+
4547 let isSecure = ! ! cookieName . match ( / ( ^ s t e a m M a c h i n e A u t h | ^ s t e a m L o g i n S e c u r e $ ) / ) ;
46- this . _jar . setCookie ( Request . cookie ( cookie ) , ( isSecure ? "https://" : "http://" ) + "store.steampowered.com" ) ;
47- this . _jar . setCookie ( Request . cookie ( cookie ) , ( isSecure ? "https://" : "http://" ) + "steamcommunity.com" ) ;
48+ let protocol = isSecure ? 'https' : 'http' ;
49+
50+ if ( requestCookie . domain ) {
51+ this . _jar . setCookie ( requestCookie . clone ( ) , protocol + '://' + requestCookie . domain ) ;
52+ } else {
53+ this . _jar . setCookie ( Request . cookie ( cookie ) , protocol + "://store.steampowered.com" ) ;
54+ this . _jar . setCookie ( Request . cookie ( cookie ) , protocol + "://steamcommunity.com" ) ;
55+ }
4856} ;
4957
5058/**
You can’t perform that action at this time.
0 commit comments