瀏覽代碼

use head instead of tail so that the sessionid cookie gets set correctly

Christophe B Billheimer 4 年之前
父節點
當前提交
d317b49940
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      dnsapi/dns_1984hosting.sh

+ 1 - 1
dnsapi/dns_1984hosting.sh

@@ -150,7 +150,7 @@ _1984hosting_login() {
   _debug2 response "$response"
 
   if _contains "$response" '"loggedin": true'; then
-    One984HOSTING_COOKIE="$(grep -i '^set-cookie:' "$HTTP_HEADER" | _tail_n 1 | _egrep_o 'sessionid=[^;]*;' | tr -d ';')"
+    One984HOSTING_COOKIE="$(grep -i '^set-cookie:' "$HTTP_HEADER" | _head_n 1 | _egrep_o 'sessionid=[^;]*;' | tr -d ';')"
     export One984HOSTING_COOKIE
     _saveaccountconf_mutable One984HOSTING_COOKIE "$One984HOSTING_COOKIE"
     return 0