Commit graph

462 commits

Author SHA1 Message Date
Johannes Müller
b39c974a90 Update to use HTTP::Server#bind_ssl (#477) 2018-08-09 00:13:45 +03:00
Serdar Dogruyol
64fbe406d5
Merge pull request #465 from kemalcr/rework-param-parser
Rework param parser
2018-08-06 20:03:12 +03:00
Lewis E. Bogan
09bb1fcd40 add a VERSION constant (#471) 2018-07-16 05:55:53 +03:00
Rafał Wojsznis
1e18389f5f Remove etag logic as it's not implemented in Crystal 0.25.1 (#470) 2018-07-16 05:54:36 +03:00
Serdar Dogruyol
4a58bc9690 Remove env.params.files and FileUpload 2018-07-04 21:42:58 +03:00
Serdar Dogruyol
d2ef57a128 Improve param parsing and remove url_params from HTTP::Request 2018-07-03 20:29:06 +03:00
Serdar Dogruyol
ad5dc053c4 Remove _method override 2018-07-03 20:29:06 +03:00
Anton Maminov
b8ec6ee328 set response status code before creating exception template (#468) 2018-07-02 10:28:00 +03:00
Serdar Dogruyol
ced34b7651 Move exceptions and exception_page under helpers dir 2018-07-01 17:47:14 +03:00
Anton Maminov
a13fe95201 Added new exception page (#466) 2018-07-01 16:43:04 +03:00
Serdar Dogruyol
d0b4c0d609 Embed 404 image as SVG 2018-06-30 14:49:39 +03:00
Serdar Dogruyol
621342170a Tidy up Kemal.run 2018-06-30 14:34:41 +03:00
Johannes Müller
bc661d58ae Refactor Kemal.run to allow custom port binding (#463) 2018-06-30 14:16:55 +03:00
Serdar Dogruyol
eed97877a7
Simplify file upload parsing and support multiple uploads with same name (#458) 2018-06-27 23:33:28 +03:00
Hirofumi Shibata
f916bad095 reset values to test with default value (#453) 2018-06-18 15:07:54 +03:00
Serdar Dogruyol
a5870e7d24
Crystal 0.25.0 (#452) 2018-06-16 18:03:00 +03:00
V. Elenhaupt
c2236acf3a Code fixes reported by static code analysis (#450) 2018-05-17 11:07:40 +03:00
Blacksmoke16
f3f7e319ae Ability to optionally disable powered-by header (#449) 2018-05-09 10:19:59 +03:00
Serdar Dogruyol
88b4737500 Don't serve 404 image dynamically 2018-03-19 22:44:24 +03:00
Serdar Dogruyol
6fbad555d0 Remove unused stuff 2018-03-17 17:58:19 +03:00
Serdar Dogruyol
536108c71b Refactor and fix some docs 2018-03-17 15:35:33 +03:00
Serdar Dogruyol
11295f0584 Revert "Don't use JSON::Type, use JSON::Any instead"
This reverts commit 34475b986a486730d696ddf52250c38d7e0cfe4a.
2018-03-10 11:11:42 +03:00
Serdar Dogruyol
db00ecba1d
Don't use JSON::Type, use JSON::Any instead (#435) 2018-03-10 11:05:34 +03:00
Serdar Dogruyol
159e963404 Format with 0.24.1 formatter 2018-01-26 18:32:24 +03:00
Serdar Dogruyol
4034dab952 Add Kemal::Context.get? to safely access context storage. Fixes #428 2018-01-26 18:30:09 +03:00
Serdar Dogruyol
56d34deef9 Minor refactors 2017-12-08 21:35:02 +03:00
Serdar Dogruyol
8cb9770ec3 Use HTTP::Params.add instead of HTTP::Params.[]= 2017-11-20 17:23:11 +03:00
Serdar Dogruyol
a3a0f40468 Revert "Parse body in multipart forms"
This reverts commit ca7c4dc0e8.
2017-11-20 15:01:16 +03:00
Serdar Dogruyol
ca7c4dc0e8 Parse body in multipart forms 2017-11-19 18:14:06 +03:00
Serdar Dogruyol
902d87c0a7
Use Flate::Writer.open (#394) 2017-11-02 18:49:41 +03:00
Flora Rosenkreuz
0b9628dfea Add webm mime type to utils.cr (#413) 2017-10-13 15:37:50 +03:00
Serdar Dogruyol
5d737ee8f3 Rename common_log_handler and common_exception_handler 2017-10-06 20:34:18 +03:00
Serdar Dogruyol
ac56973663 Format 2017-10-06 14:59:53 +03:00
Sijawusz Pur Rahnama
1d8908e673 Fixed macros indentation (#409) 2017-10-06 14:55:37 +03:00
Sijawusz Pur Rahnama
210e2c0801 Prettify docs (#410) 2017-10-06 14:53:53 +03:00
Serdar Dogruyol
c2da18ed38 Use .empty? instead 2017-10-06 13:41:22 +03:00
Serdar Dogruyol
84839f4da7 Refactour handler radix names 2017-10-06 12:46:58 +03:00
Serdar Dogruyol
63e613a439 Don't try to call error_handlers if there isn't any 2017-10-05 19:52:57 +03:00
Serdar Dogruyol
dfd127e1ed Don't use handler as the IO name 2017-10-05 19:31:47 +03:00
Serdar Dogruyol
677dc62832 Remove dead code for WebSocketHandler 2017-10-05 19:29:35 +03:00
Serdar Dogruyol
0b07070237 Don't initiliaze server if it's already initialized 2017-10-04 19:51:14 +03:00
Serdar Dogruyol
ad692357d4 Allow config.server to be lazily initiliazed. Fixes #396 2017-10-04 19:42:41 +03:00
Serdar Dogruyol
61caa077b7 Improve namings 2017-10-02 23:56:02 +03:00
Cris Ward
30bdcc9759 only return strings from routes fixes #374 (#408) 2017-10-02 23:47:43 +03:00
Cris Ward
8cf3f67594 fix for #399 (#407)
* fix for #399

* updating travis

* added without release back in

* added no debug to get around llvm issue
2017-09-29 09:25:26 +03:00
Serdar Dogruyol
a27e8859a6 Merge pull request #405 from crisward/patch-4
Fix for video in safari
2017-09-28 19:16:20 +03:00
Cris Ward
03daf2aee2 Added Accept-Ranges header 2017-09-28 16:02:37 +01:00
Cris Ward
183ae42a54 corrected content length 2017-09-28 14:17:12 +01:00
Cris Ward
6c11f943d0 Better fix for safari video bug
This seems to work everywhere that I've tested.
2017-09-28 12:07:26 +01:00
Cris Ward
1423c96d0a Allows videos to be opened with correct mime type 2017-09-28 11:13:55 +01:00
Cris Ward
81f2ee7815 Fix for video in safari
Video doesn't work safari.

It seem to be to do with the content-range header. Safari initially asked for the first byte. 
However with a single byte request, the header outputs
`bytes 0-0/1000` (if this file is 1000 bytes in size)

It does work however if we make the end value 1. But removing the `-1` breaks it in chrome. So I suggest this change, which means the end can't be smaller than 1.
2017-09-28 11:12:44 +01:00
Serdar Dogruyol
00981bcf44 Improve websocket match logic. Fixes #401 2017-09-14 19:59:22 +03:00
Serdar Dogruyol
e07be72dcf Remove ws_routes from route handler 2017-09-10 15:45:57 +03:00
Serdar Dogruyol
fe9d193418 Seperate websocket and websocket handler. Fixes #395 2017-09-10 14:41:07 +03:00
Serdar Dogruyol
3050b75f0a Tidy up config properties 2017-09-06 23:58:55 +03:00
Serdar Dogruyol
731b2e0d5b Bump version to 0.21.0 2017-09-05 14:07:46 +03:00
Serdar Dogruyol
8fb5be2a42 Remove redundant casts 2017-09-05 12:03:37 +03:00
Serdar Dogruyol
1c069ab643 Refactor 2017-09-05 11:10:04 +03:00
mang
249912222d Set correct namespace for Route
Fixes compile error "undefined constant Route"
2017-09-05 01:25:42 +02:00
Serdar Dogruyol
422313425c Remove redundant intermediate var from process_route 2017-09-04 23:46:53 +03:00
Serdar Dogruyol
b8e3298925 Use request.content_type 2017-09-04 18:54:06 +03:00
Serdar Dogruyol
a1520de7ed Leave tmpfile management to OS 2017-09-04 17:46:09 +03:00
Serdar Dogruyol
79e324efaf Add more types to method signatures 2017-08-25 16:41:02 +03:00
Serdar Dogruyol
00217d9545 Add more types to method signatures 2017-08-24 23:32:43 +03:00
Serdar Dogruyol
efd97b75f9 Refactor 2017-08-24 18:52:10 +03:00
Serdar Dogruyol
cfedc7c538 Add docs for static_headers 2017-08-24 01:24:19 +03:00
Sdogruyol
607aaeffe3 Allow headers in built-in static file server 2017-08-22 15:29:51 +03:00
Sdogruyol
3fd3349383 Don't raise on WS route not found 2017-08-21 12:38:28 +03:00
Sdogruyol
2b604dfb30 Add context to WebSocket. This allows one to use context.params like url,query, body e.g 2017-08-20 20:01:49 +03:00
Will Leinweber
5a83522866 allow %w in Handler macros (#385) 2017-08-18 10:19:21 +03:00
Benoist
fc4c97aafd Null logging should not print anything to STDOUT (#381) 2017-07-30 15:08:02 +03:00
Cris Ward
cd5fab8c2f X-Content-Type-Options = "nosniff" #379 (#380)
security header for older browsers to prevent content sniffing
2017-07-22 10:34:47 +03:00
sdogruyol
1d056b203b Dynamically insert handlers. Fixes #376 2017-07-11 11:22:35 +03:00
sdogruyol
b194b0b03c Don't use single line block syntax 2017-06-23 12:18:40 +03:00
sdogruyol
0724e07c22 Make Route a Struct 2017-05-13 18:39:11 -07:00
sdogruyol
ce024ba748 Use replace instead of each for replacing handlers 2017-05-13 09:16:59 -07:00
sdogruyol
62946fd987 Modularize handlers 2017-05-12 16:18:50 -07:00
sdogruyol
9f01eb90e1 Format 2017-05-09 10:46:25 +03:00
sdogruyol
e695a491b7 Revert "Modiy HTTP::Params.[] to fetch all params"
This reverts commit c0745cc9e25068e9ce832ca5a79519de516ca4e5.
2017-05-08 17:28:21 +03:00
Rimas Silkaitis
0b4856b741 User defined context store types (#339)
allow the context storage to handle any types
2017-04-06 21:43:41 +03:00
Cris Ward
48128696c6 Prevent send_file returning filesize (#344)
Prevent send_file returning filesize
2017-03-29 15:09:25 +03:00
Sdogruyol
f511d21aa1 Dont call setup in config#add_filter_handler. Fixes #338 2017-03-25 20:37:11 +03:00
Sdogruyol
f4de825ab8 Revert "Skip files with empty #size in ParamParser, fixes #309 (#333)"
This reverts commit d0c034b911.
2017-03-18 00:47:04 +03:00
Faustino Aguilar
4409f56ba7 404 responsive Kemal logo (#334)
Add responsive width to Kemal logo.
2017-03-17 11:16:38 +02:00
Serdar Dogruyol
1177619da9 Modiy HTTP::Params.[] to fetch all params (#328) 2017-03-13 16:52:42 +02:00
Sijawusz Pur Rahnama
d0c034b911 Skip files with empty #size in ParamParser, fixes #309 (#333) 2017-03-12 19:30:30 +02:00
Sijawusz Pur Rahnama
e0511743b1 Add getters to Route#{path,method} (#332) 2017-03-12 18:40:30 +02:00
Cris Ward
298a4b234b moved static file handler code to send_file (#330) 2017-03-12 14:38:47 +02:00
Sijawusz Pur Rahnama
e276c0a278 Fix regression introduced in 1afb4cbfa8 (#331) 2017-03-12 14:37:23 +02:00
Cris Ward
e6757d9a61 Added mime-type for favicons (#329) 2017-03-12 00:23:33 +02:00
Cris Ward
1c527c2d94 return no body for head route fixes #323 (#325) 2017-03-10 13:13:38 +02:00
Sdogruyol
a430b85ee7 Remove Gzip hack since https://github.com/crystal-lang/crystal/issues/4060 is fixed 2017-03-07 19:47:39 +03:00
Sdogruyol
8331beceef Move Crystal core classes to ext 2017-03-04 00:01:26 +03:00
Sdogruyol
596452f838 More docs 2017-03-03 23:56:29 +03:00
Sdogruyol
7a772a9301 Improve docs 2017-03-03 23:42:08 +03:00
Brian J. Cardiff
25af53b70d apply :nodoc: only to Kemal::FileUpload instead of the whole Kemal (#320) 2017-03-02 12:15:48 +02:00
Sdogruyol
d0e04918c3 Improve helper doc 2017-02-27 23:03:09 +03:00
Sdogruyol
b91f8a87eb Improve helpers doc 2017-02-27 22:20:17 +03:00
Sdogruyol
e6af97c256 Make static_file_handler#etag private 2017-02-27 19:21:14 +03:00
Sdogruyol
2fe27f0890 Make FilterBlock inner class of Kemal::FilterHandler 2017-02-27 19:10:49 +03:00