Skip to content
This repository has been archived by the owner on Aug 5, 2024. It is now read-only.

Commit

Permalink
disable keep-alive on session level
Browse files Browse the repository at this point in the history
  • Loading branch information
dynasticorpheus committed Apr 28, 2015
1 parent 3f445bc commit 5378acb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gigasetelements-cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,8 @@ def is_json(myjson):

def restget(url):
data = ''
nokeepalive = {"Connection": "close"}
try:
r = s.get(url, timeout=15, stream=False, headers=nokeepalive)
r = s.get(url, timeout=15, stream=False)
except requests.exceptions.RequestException as e:
log(str(e.message), 3, 1)
if r.status_code != requests.codes.ok:
Expand Down Expand Up @@ -336,6 +335,7 @@ def status():
exist_module('requests', 'requests')
import requests
s = requests.Session()
s.headers['Connection'] = 'close'

connect()

Expand Down

0 comments on commit 5378acb

Please sign in to comment.