mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'feature/esp_prov_session_cookie_support' into 'master'
esp_prov: added support for session cookie in SoftAP mode Closes IDF-2642 See merge request espressif/esp-idf!20837
This commit is contained in:
commit
7d1b645cd2
@ -39,6 +39,13 @@ class Transport_HTTP(Transport):
|
||||
try:
|
||||
self.conn.request('POST', path, tobytes(data), self.headers)
|
||||
response = self.conn.getresponse()
|
||||
# While establishing a session, the device sends the Set-Cookie header
|
||||
# with value 'session=cookie_session_id' in its first response of the session to the tool.
|
||||
# To maintain the same session, successive requests from the tool should include
|
||||
# an additional 'Cookie' header with the above recieved value.
|
||||
for hdr_key, hdr_val in response.getheaders():
|
||||
if hdr_key == 'Set-Cookie':
|
||||
self.headers['Cookie'] = hdr_val
|
||||
if response.status == 200:
|
||||
return response.read().decode('latin-1')
|
||||
except Exception as err:
|
||||
|
Loading…
Reference in New Issue
Block a user