1
0
Fork 0
mirror of https://github.com/KingDuckZ/kamokan.git synced 2025-01-13 19:56:40 +00:00
Commit graph

26 commits

Author SHA1 Message Date
9cda58d0c0 Rename tawashi to duckbin.
The library that used to be "tawashi_implem" now
is simply called tawashi.
2017-06-02 21:53:27 +01:00
2f00014758 Fail if CONTENT_TYPE is not application/x-www-form-urlencoded.
As part of the partial improvement to the POST reading
code I also added a max_post_size setting which defaults
to 1 MiB. POST inputs longer than that size get truncated.
This is separate to max_pastie_size, which is just the
size of one of the values in the POST data.
2017-06-02 09:23:35 +01:00
9fff9d793c Move ip requesting code into a separate file and make hashing configurable at build time.
New code tries to guess a per-visitor IP address and uses
that (or its hash) to tell users apart.
This patch also adds a TAWASHI_WITH_IP_LOGGING cmake option
to enable or disable logging the IP address of your visitors
in various places (just one right now but don't assume things
to remain this way).
Also added a couple new CGI environment variables.
2017-05-24 09:34:52 +01:00
1507c79503 Clean up and make a separate class for pasties from curl-style requests. 2017-05-24 09:05:03 +01:00
53b5a1a2af Hack to quickly get a new pastie's address when invoked from curl. 2017-05-23 20:34:46 +01:00
810c321515 Redirects always use 3xx status codes. 2017-05-18 22:38:09 +01:00
2e4d869370 Individually log failure for non-vital missing POST variables. 2017-05-18 19:17:22 +01:00
71ec9925f4 Fix sent http status codes. 2017-05-18 19:17:22 +01:00
aaa28d3454 Assign the actual numbers to the HTTP status codes enum.
This allows me to get rid of a good deal of crap.
2017-05-18 19:17:22 +01:00
cdd23d35d0 Make on_process() return an HttpHeader.
Response type is now decided by on_process' return value.
2017-05-18 19:17:22 +01:00
59a5d35ee0 Try to fix redirect not working properly. 2017-05-17 00:03:43 +01:00
a1fa8cc1d2 Bugfix, don't redirect when the returned token is empty. 2017-05-16 22:06:36 +01:00
e77b9dafbb Log when redirecting to the error page. 2017-05-16 21:52:48 +01:00
10da16051c Organize exceptions so it's easy to log errors locally. 2017-05-16 18:54:00 +01:00
ba1b417f07 Fix wrong parameter in redirect address. 2017-05-15 09:33:31 +01:00
ec80734625 Add http status codes and save dummy error into the mstch context. 2017-05-14 03:38:41 +01:00
4d31323bb1 Redirect to error.cgi when saving fails.
Not working yet, still getting there.
2017-05-12 22:46:54 +01:00
73707c2ad0 Revert "Pass the ResponseFactory object down to the Response itself."
This reverts commit 3bc6c56c03.
2017-05-12 22:18:03 +01:00
3bc6c56c03 Pass the ResponseFactory object down to the Response itself. 2017-05-12 09:36:01 +01:00
10da75caf5 Remove parameters from Response's constructor.
They can safely be defaulted and derived classes can
change their preferences later inside their constructor
if they need to.
2017-05-12 09:18:49 +01:00
f286507edf Delay fast subsequent pasties from the same IP. 2017-05-11 18:50:56 +01:00
9e63a648a1 Protect against fast flooding from the same ip. 2017-05-11 09:48:18 +01:00
ed1343bd7b Pass the istream to read_post instead of assuming std::cin. 2017-05-10 20:42:42 +01:00
cd1be59cfa Pass the output stream and cgi_env to Response.
Mask the fact that they are globals, because I need
to be able to pass different classes in order to be
able to write unit tests for response classes.
2017-05-06 19:48:44 +01:00
8980a1d1ff I don't really need to store the page name in the base class. 2017-05-06 19:16:57 +01:00
e1687c96ff Split tawashi into lib+executable to enable unit testing 2017-05-04 19:52:18 +01:00
Renamed from src/submit_paste_response.cpp (Browse further)