You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[x ] I have read the documentation at readthedocs and the issue is not addressed there.
I have tested that the issue is present in current master branch (aka latest git).
[x ] I have searched the issue tracker for a similar issue.
If there is a stack dump, I have decoded it.
[x ] I have filled out all fields below.
Platform
Hardware: [ESP-12]
Core Version: [3.0.1]
Development Env: [Arduino IDE]
Operating System: [Windows]
Settings in IDE
Module: [Wemos D1 mini r2]
Flash Mode: [qio]
Flash Size: [4MB]
lwip Variant: [v2 Higher Bandwidth]
Reset Method: [nodemcu]
Flash Frequency: [80Mhz]
CPU Frequency: [80Mhz]
Upload Using: [OTA]
Upload Speed: [115200] (serial upload only)
Problem Description
Accordind to the comment in ESP8266WebServer.h - if the client sends the "Connection" header, the value given by the header is used. But in fact, both server.keepAlive(true); and server.sendHeader(F("Connection"), F("close")); server.send(200); is present in the header.
HTTP/1.1 200 OK
Content-Type: Connection: close
Content-Length: 0 Connection: keep-alive
Keep-Alive: timeout=2000
UDP:
For some reason short version server.send(200, F("Connection"), F("close")); doesn't work (only keep-alive is present).
The text was updated successfully, but these errors were encountered:
Accordind to the comment in ESP8266WebServer.h - if the client sends the "Connection" header, the value given by the header is used. But in fact, both server.keepAlive(true); and server.sendHeader(F("Connection"), F("close")); server.send(200); is present in the header.
Connection: {Keep-Alive,close} is not meant to be sent by the user, but by the server internals through setting keep alive flag. But, I suppose we may add some code to reject such internal header(s). Internally, keep-alive is first sourced from the HTTP version, then checks whether the request contains Connection: and again updates the flag when it equals to keep-alive and otherwise defaults to close
Plus, I don't see how multiple 'Connection's may sneak into the response headers string; server code only sends it once. But, we don't check for unique / duplicates / internal header fields, so it is possible for user to inject something unexpected (and the spec technically allows it)
For some reason short version server.send(200, F("Connection"), F("close")); doesn't work (only keep-alive is present).
Invalid? Call will respond with 'content-type: connection' and 'close' in the body
Basic Infos
Platform
Settings in IDE
Problem Description
Accordind to the comment in ESP8266WebServer.h - if the client sends the "Connection" header, the value given by the header is used. But in fact, both server.keepAlive(true); and server.sendHeader(F("Connection"), F("close")); server.send(200); is present in the header.
HTTP/1.1 200 OK
Content-Type:
Connection: close
Content-Length: 0
Connection: keep-alive
Keep-Alive: timeout=2000
UDP:
For some reason short version server.send(200, F("Connection"), F("close")); doesn't work (only keep-alive is present).
The text was updated successfully, but these errors were encountered: