f94cc9409b
Add test for SubmitPasteResponse.
2017-06-06 00:56:01 +01:00
974424398f
Remove hardcoded path to my own machine.
2017-06-05 23:57:47 +01:00
4ba3b679fc
Read POST in the Response so I can override it for testing.
2017-06-05 23:56:59 +01:00
fb27563fdd
Make functions virtual when building with testing.
2017-06-05 23:02:39 +01:00
c302dbee73
Hide calls to Incredis in the Storage class.
...
This should allow me to write some decent
simulation tests.
2017-06-05 21:57:14 +01:00
99e52ceb75
More logging, try to fix the 502 gateway error.
2017-06-05 19:53:32 +01:00
640315cbba
Another attempt at fixing the 502 Gateway error.
2017-06-05 09:20:37 +01:00
26d8b553d7
Version bump to 0.2.2.
2017-06-04 23:06:27 +01:00
78156cea75
Off by 1?
2017-06-04 23:05:56 +01:00
87b6f85913
Version bump to 0.2.1.
2017-06-04 22:14:50 +01:00
1a7ec9c2c4
Use REQUEST_URI instead of PATH_INFO.
2017-06-04 22:14:05 +01:00
2293604e11
Fix tests' build.
2017-06-03 21:16:23 +01:00
defc365d21
Update link to renamed github page
2017-06-03 21:03:09 +01:00
cb2d163981
...rename duckbin to kamokan --> 鴨缶. yay!
2017-06-03 20:52:57 +01:00
ae283b6c96
Version bump to 0.2.0
2017-06-02 22:15:41 +01:00
2338ecbdb5
Rename tawashi to duckbin in the html.
2017-06-02 21:58:23 +01:00
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
24baf67a65
Use the new SplitMime in the HttpHeader.
...
Something like the old m_param string is still needed
because Location responses need to send an URL.
The type of the response now determines if m_mime
or m_redirect_location is used.
2017-06-01 09:09:21 +01:00
5640cb5769
Remove debug text that was breaking the http response.
...
Also check if there are tabs in the mime parameter.
2017-06-01 09:06:10 +01:00
22a4503e0e
Merge branch 'mime_karma'
2017-05-31 19:54:47 +01:00
009341233d
Use karma to make mime strings from structs.
2017-05-31 19:53:46 +01:00
84470cfc57
Add a host_path token to mustache.
...
It expands to the host_path setting in the ini file, with
the last slash removed if present. Use it to make absolute
links like {{host_path}}/tawashi.css.
2017-05-28 17:06:14 +01:00
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
5d4041aed8
Minor style change.
2017-05-25 00:51:39 +01:00
ea55602f6b
Implement mime_split.
...
It will be used to detect received content types.
2017-05-25 00:51:26 +01:00
eef10a3d5e
REQUEST_METHOD must be given or better_enums will complain.
2017-05-24 22:26:55 +01:00
4e32006e08
Don't respond if the request method is unexpected.
...
This includes the jolly responder, which now only works
for GET requests.
2017-05-24 19:09:42 +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
a2676ad5c7
Version bump to 0.1.11
2017-05-23 20:34:51 +01:00
53b5a1a2af
Hack to quickly get a new pastie's address when invoked from curl.
2017-05-23 20:34:46 +01:00
847988f4bd
No need to prepare mustache context if no body is required.
2017-05-23 20:24:56 +01:00
7549c0e664
Don't crash when a pastie doesn't exist, redirect to error page instead.
2017-05-23 20:15:41 +01:00
8b94672b25
Register a separate maker for requests to "" POST.
2017-05-23 19:59:49 +01:00
27881ed0f0
Allow registering makers specific to POST or GET requests.
2017-05-23 19:59:49 +01:00
014f18ec57
Simplify prefix len calculation and make it more flexible.
...
The prefix in tawashi.ini now can omit the trailing /.
If missing, it will still be trimmed from PATH_INFO if
necessary.
2017-05-23 19:59:49 +01:00
2571e70093
Allow to give the css file for the highlighter in tawashi.ini
2017-05-23 18:31:55 +01:00
7ada0f155b
Make non-highlighted pasties white so they are readable.
...
Also disable line number generation as I plan to add them
in a different way later on.
2017-05-23 09:24:11 +01:00
7115e9eb63
Use a light colours style for highlighted pasties.
2017-05-23 09:14:33 +01:00
93c19c2b88
Version bump to 0.1.10.
2017-05-22 21:05:10 +01:00
54d50cf6bc
Basic check to tell if a string looks like a possibly valid number.
2017-05-22 21:04:26 +01:00
51810fa2f2
Always remove the trailing slash from computed URI.
2017-05-22 20:32:20 +01:00
6ea74d090a
Set plain text mode *before* returning.
2017-05-22 20:28:18 +01:00
9f8d89895d
Make a new test project for full-page testing.
2017-05-22 20:08:28 +01:00
e2437a6b12
Add more logging and error checking.
2017-05-22 09:27:17 +01:00
60d9641538
Version bump to 0.1.9.
2017-05-19 20:02:05 +01:00
d3319512f4
Case-insensitive check for HTTPS=on.
2017-05-19 19:48:31 +01:00
adcfc75f97
Add a simple unit test for invalid utf8 sequences in env vars.
2017-05-19 19:44:34 +01:00
3e524dd9f5
Fix wrong text size in unit test.
2017-05-19 19:22:45 +01:00