Closed michalpokusa closed 1 year ago
@FoamyGuy Thank you for testing and review, I believe the PR is now ready to be merged and released as 4.4.0.
Some time ago there was also an issue about a link in release, seems it was not closed with previous release https://github.com/adafruit/Adafruit_CircuitPython_HTTPServer/issues/65
Despite multiple new features, the overall API itself didn't change much. I believe theese changes, if it comes to that, should be released as 4.x.0 and not 5.0.0.
⭐ Added:
Token
authentication class, works the same way asBearer
, but with "Token ..." prefixMOVED_PERMANENTLY_301
andFOUND_302
Status
objectsHeaders
got new methods:get_directive()
andget_parameter()
,add
andset
Request.cookies
for retrieving andcookies
parameter for setting in allResponse
-like classesrequest.form_data.files
that uses newFiles
andFile
classes for representing files uploaded usingmultipart/form-data
🪛Fixes:
tuple
as possibleRoute.methods
parameter type, changed typing fromUnion
toIterator
🛠️ Updated/Changed:
Redirect
got newpreserve_method
parameter, which allows it to switch between301
,302
,307
and308
Redirect
got newstatus
parameter, which allow for manual status code settingRedirect
192.168.0.103 -- "GET /index.html" 242 -- "200 OK" 154 -- 182ms
FormData
QueryParams
,FormData
andHeaders
, especially inget()
andget_list()
Server.serve_forever
now acceptspoll_interval
parameter which adds delay between calling.poll()
FormData.__init__()
for edge cases, e.g. when there is noContent-Type
header inPOST
requestRequest.json()
can now be accessed inPUT
,PATCH
andDELETE
requests🏗️ Refactor:
_IFieldStorage
tointerfaces.py
, also added_IXSSSafeFieldStorage
version of interface that enables encoding HTML entitiesQueryParams
andFormData
implement_IXSSSafeFieldStorage
Headers
now implements_IFieldStorage
and does not store original case of header names, functionally it is the samemultipart/form-data
form dataI hope I included everything.