Commit graph

59 commits

Author SHA1 Message Date
michalpokusa
f95781a050 Rewrite of Response logic from context managers to returns, added some new types of response 2023-05-08 09:01:12 +00:00
michalpokusa
e3529d6e37 Moved debugging exception to .poll() 2023-05-07 21:37:00 +00:00
michalpokusa
55be729bfa Fix: Incorrectly changing from list to set using brackets 2023-05-05 22:03:18 +00:00
michalpokusa
a424d27098 Added ... and .... wildcards 2023-05-03 13:53:30 +00:00
michalpokusa
191e91c928 Changed format of debug logs, added Response.size, fix in send_chunk 2023-05-03 09:25:06 +00:00
michalpokusa
33d6b25c5e Refactor of _Route and _Routes, added append_slash 2023-05-03 09:25:06 +00:00
michalpokusa
a5be235a96 Added stopping server on Ctrl-C and debug message on stop 2023-05-01 00:47:00 +00:00
michalpokusa
dbdbacd7f4 Added Server.debug for verbose messages during development 2023-04-30 23:26:49 +00:00
michalpokusa
0607776e7a Added host and port attributes to Server 2023-04-30 21:05:59 +00:00
michalpokusa
e1d3e3b820 Added method for verifying that server can be started on given host:port 2023-04-30 21:03:24 +00:00
michalpokusa
752dcaf343 Returning from serve_forever on KeyboardInterrupt 2023-04-30 11:18:42 +00:00
michalpokusa
07782b68e7 Removed accidentally commited leftover 2023-04-29 13:34:37 +00:00
michalpokusa
eba7a91146 Added Server.stop 2023-04-29 00:02:04 +00:00
michalpokusa
19148a5d1e Extensive updates and expansion of docs and examples 2023-04-28 12:23:54 +00:00
michalpokusa
15b00cb1ba Added server parameter to Request 2023-04-28 11:06:27 +00:00
michalpokusa
85254e5b92 Changes to docstrings 2023-04-27 20:40:23 +00:00
michalpokusa
e5ddaaf0d7 Refactor of .poll and .server_forever, added option to disable filesystem access 2023-04-26 23:57:34 +00:00
michalpokusa
142c89ba6a Added option to restrict access to whole Server with Authentication 2023-04-26 23:46:43 +00:00
michalpokusa
33fecc9827 Allowed passing multiple methods at the same time to .route 2023-04-25 21:27:12 +00:00
michalpokusa
4224ac87c4 Replaced CommonHTTPStatus with direct values 2023-04-25 21:27:12 +00:00
michalpokusa
d4a8a8dc3f Removed HTTP... prefix from class names 2023-04-25 21:27:10 +00:00
michalpokusa
75ac0f2b49 Added authentication logic, AuthenticationError, UNAUTHORIZED_401 status 2023-04-25 21:26:15 +00:00
foamyguy
0850abad7b
Merge pull request #45 from foxy82/main
Fix infinite loop when requesting too quickly
2023-04-24 09:35:39 -05:00
michalpokusa
394c6f3952 Merge commit 'a8b68f153b72b8c022eceec254abe129cf5f5802' into prevent-parent-directory-access 2023-04-19 17:10:38 +00:00
michalpokusa
0467a276e2 Updated HTTPServer constructors to use "/static" as root path 2023-04-16 09:32:21 +00:00
michalpokusa
d89e66e78e Added checking for .. and backslash in path, introduced custom exceptions 2023-04-16 09:31:28 +00:00
michalpokusa
e7a2debc67 Minor changes in comments 2023-04-14 02:53:09 +00:00
michalpokusa
77bc821c38 Moved root_path from start and server_forever methods to constructor 2023-04-13 23:23:13 +00:00
Neradoc
9ea26651f8 allow HEAD requests to files paths 2023-04-13 18:32:31 +02:00
foxy82
1649a45700
Update server.py
Ensure unexpected OSError isn't swallowed.
2023-04-03 12:31:00 +01:00
michalpokusa
cf6903599f Removed old deprecation error 2023-03-20 03:11:05 +00:00
michalpokusa
78cfa0e022 Updated examples and added new ones hat present added functionality 2023-03-19 15:49:21 +00:00
michalpokusa
c95290f390 Replaced route_handlers dict with _HTTPRoutes object in HTTPServer 2023-03-19 15:07:44 +00:00
foamyguy
874d3ed886
Merge pull request #37 from matemaciek/main
Buffer_size improvements
2023-02-06 15:32:32 -06:00
Maciej Sokołowski
9808f15e2e
Auto-serve index.html for root path 2023-01-20 14:51:10 +01:00
Maciej Sokołowski
4e63771c3b
Expose buffer_size in response.send_file, adjust default to match the one in server 2023-01-20 09:57:19 +01:00
michalpokusa
c609a821d5 Changed address to client_address to match CPython's http.server module naming 2023-01-02 17:22:53 +00:00
michalpokusa
c758e519c0 Changed root to root_path in docstrings 2022-12-28 17:44:05 +00:00
michalpokusa
f0b61a721f Prevented from calling .send() multiple times and added deprecation error if handler returns HTTPResponse 2022-12-26 01:52:39 +00:00
michalpokusa
00d3247825 Refactor for unifying the HTTPResponse API 2022-12-23 11:55:57 +00:00
michalpokusa
c1d2f55c46 Merge remote-tracking branch 'origin/main' into test 2022-12-23 11:54:37 +00:00
michalpokusa
d547c7fa39 Fixed and extended docstrings 2022-12-19 20:24:31 +00:00
paul-1
4768bbd20a Add Chunked Encoding to minimize memory usage for
large dynamic html pages.
2022-12-14 20:00:41 -05:00
paul-1
e66cfbfcb5 Add Cache-Control to headers. 2022-12-14 19:58:14 -05:00
michalpokusa
469f0eb9a0 Implemented processing 'Content-Length' header and limiting received bytes 2022-11-22 04:40:52 +00:00
michalpokusa
04805467cb Changed default socket_timeout and made it possible to be a positive number only 2022-11-20 14:17:13 +00:00
michalpokusa
85d1c3cc89 Changed how incoming data is received
Solved problem when data is sent in chunks and is not received in full.
Bypassed ESP32 TCP buffer limit of 2880 bytes.
2022-11-19 02:08:04 +00:00
michalpokusa
eaea81d923 Added HTTPServer.socket_timeout 2022-11-19 02:07:31 +00:00
michalpokusa
6585d3f709 Resolving rest of pylint and black errors 2022-11-14 00:34:05 +00:00
michalpokusa
21e20b6041 Preparing code for docs generation, black formatting, updating examples 2022-11-13 23:26:25 +00:00