King_DuckZ
c86df2de07
Move some pastie fetching logic into Storage.
...
I'm implementing an "edit" page, so I also need to retrieve
a pastie from there and I want to minimize code duplication.
2017-06-16 08:11:26 +01:00
King_DuckZ
218e9ab6cd
Add a bool to mustache to tell if a pastie got self-destructed.
2017-06-14 20:31:17 +01:00
King_DuckZ
b6edab7171
Implement self-destruct upon read when selfdes=1 in POST
2017-06-14 20:19:18 +01:00
King_DuckZ
e5f7f60e8b
Change namespace of kamokan-specific stuff.
2017-06-13 09:36:53 +01:00
King_DuckZ
6c357f1dc7
Separate Tawashi and Kamokan.
...
Unit tests are still a bit mixed up, but that should
be simple to split once I have a separate repo for
Tawashi.
2017-06-13 09:36:12 +01:00
King_DuckZ
43e97ee79b
Fix data corruption when submitting a pastie.
2017-06-08 23:38:11 +01:00
King_DuckZ
056e7dcde4
Use stock std::string conversion.
2017-06-07 00:30:43 +01:00
King_DuckZ
eaf8c0778d
Replace string_ref with string_view in test.
2017-06-07 00:18:52 +01:00
King_DuckZ
e44611301c
Fix the problem with redis not being initialized anymore.
2017-06-06 19:40:52 +01:00
King_DuckZ
b0c62fcab3
Add HTTP/1.1 to Status in cgi responses.
2017-06-06 00:56:28 +01:00
King_DuckZ
f94cc9409b
Add test for SubmitPasteResponse.
2017-06-06 00:56:01 +01:00
King_DuckZ
974424398f
Remove hardcoded path to my own machine.
2017-06-05 23:57:47 +01:00
King_DuckZ
2293604e11
Fix tests' build.
2017-06-03 21:16:23 +01:00
King_DuckZ
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
King_DuckZ
009341233d
Use karma to make mime strings from structs.
2017-05-31 19:53:46 +01:00
King_DuckZ
4ff6719077
Fix bug in the mime parser.
...
The token rule was matching even when the quoted_string
rule should have matched, which was preventing the "
stripping to work. In fact quoted_string was never being
used.
Also improve formatting of long lines.
2017-05-25 19:09:11 +01:00
King_DuckZ
ea55602f6b
Implement mime_split.
...
It will be used to detect received content types.
2017-05-25 00:51:26 +01:00
King_DuckZ
eef10a3d5e
REQUEST_METHOD must be given or better_enums will complain.
2017-05-24 22:26:55 +01:00
King_DuckZ
9f8d89895d
Make a new test project for full-page testing.
2017-05-22 20:08:28 +01:00
King_DuckZ
adcfc75f97
Add a simple unit test for invalid utf8 sequences in env vars.
2017-05-19 19:44:34 +01:00
King_DuckZ
3e524dd9f5
Fix wrong text size in unit test.
2017-05-19 19:22:45 +01:00
King_DuckZ
34daf8e411
Decompose the base_uri option.
...
This allows support for having tawashi in a subdirectory
of your domain, eg http://example.com/tawashi
2017-05-19 10:01:22 +01:00
King_DuckZ
7fc7e2fba8
Remove test-only stuff that is not necessary anymore.
...
Env reads environment variables from the list it receives
from main(), so I can also pass it a forged list now
without needing extra classes with sometimes-virtual methods
or other cruft.
2017-05-15 09:18:11 +01:00
King_DuckZ
73707c2ad0
Revert "Pass the ResponseFactory object down to the Response itself."
...
This reverts commit 3bc6c56c03
.
2017-05-12 22:18:03 +01:00
King_DuckZ
3bc6c56c03
Pass the ResponseFactory object down to the Response itself.
2017-05-12 09:36:01 +01:00
King_DuckZ
d449781c40
Add unit test for utf8 sanitization.
2017-05-10 20:47:24 +01:00
King_DuckZ
07135f215c
Delete get_env, which confused me a lot.
...
Get raw environment variables directly from main().
Add code to split on '=' in cgi_environment_vars and only pick
the ones that are interesting, just as before.
2017-05-08 19:46:14 +01:00
King_DuckZ
df384f5128
Add unit test for IndexResponse.
2017-05-06 21:49:46 +01:00
King_DuckZ
ebed6fd1d4
Fix unit test for IniParser.
...
I'm not sure why graph needs the -eol part for the
value part, hopefully I'll find out at some point.
2017-05-06 18:40:39 +01:00
King_DuckZ
5b59ca3c41
Add unit test for IniFile and improve parser.
...
The test still fails because for some reason the parser
doesn't want to skip the trailing spaces in values.
2017-05-06 02:01:05 +01:00
King_DuckZ
b4291becf0
Add unit test for the SettingsBag.
2017-05-05 09:48:46 +01:00
King_DuckZ
85363e0db1
Add an empty unit test.
2017-05-04 23:03:53 +01:00