Commit Graph

41 Commits

Author SHA1 Message Date
Alexander Zhou d53d253620 Eliminated several seconds of delay when loading big mp4 file 2022-05-31 17:14:59 +03:00
Brian J. Cardiff a8c0f09b85
Upgrade to Crystal 0.35.0 (#570)
* Update to ameba ~> 0.12.0

* Use Compress::Deflate and Compress::Gzip

* Drop unused require

* Fix spec due to defer request upgrade
2020-06-10 21:11:43 +03:00
Todd Sundsted 70684a2cf0
Pick up transitional type aliases. (#566) 2020-05-16 18:22:13 +03:00
Omar Roth 18ddc3b4e6 Fix static file handler for files > 2^31 bytes (#546) 2019-08-03 19:37:23 +03:00
Sijawusz Pur Rahnama b7bf9d771f Use Crystal built-in MIME registry (#516) 2019-02-05 10:26:45 +03:00
Anton Maminov 6f111ffbb0 allow to set filename for send_file
if the disposition type matches "attachment", this
indicates that the recipient should prompt the user to save the response
locally, rather than process it normally
2018-12-23 13:24:27 +02:00
Julien Reichardt 21ab64511a Add allocation optimizations (#487) 2018-11-01 14:29:05 +03:00
Serdar Dogruyol a5870e7d24
Crystal 0.25.0 (#452) 2018-06-16 18:03:00 +03:00
Serdar Dogruyol 902d87c0a7
Use Flate::Writer.open (#394) 2017-11-02 18:49:41 +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 210e2c0801 Prettify docs (#410) 2017-10-06 14:53:53 +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 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 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 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
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 62946fd987 Modularize handlers 2017-05-12 16:18:50 -07:00
Cris Ward 48128696c6 Prevent send_file returning filesize (#344)
Prevent send_file returning filesize
2017-03-29 15:09:25 +03:00
Cris Ward 298a4b234b moved static file handler code to send_file (#330) 2017-03-12 14:38:47 +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
Serdar Dogruyol b7ce53e5ab Crystal 0.21.0 support (#304)
Crystal 0.21.0 support
2017-02-21 21:24:11 +02:00
Serdar Dogruyol 6fe57d5e78 Better file upload 2017-02-11 15:33:42 +02:00
sdogruyol b4c10a3f59 Remove basic auth middleware 2016-11-26 21:51:06 +03:00
sdogruyol 8ec9ed8331 Improve docs 2016-11-10 16:38:29 +03:00
Serdar Dogruyol 3342007701 Yield UploadFile in parse_multipart (#224) 2016-10-12 16:51:28 +03:00
sdogruyol 7efe69ac31 Add multipart support <3 2016-10-01 18:18:28 +03:00
Cris Ward a8cc4f4177 gzip static files options dir listing and etags
format
2016-09-18 01:46:16 +01:00
sdogruyol 4cd30839a5 Add gzip helper to enable/disable HTTP::DeflateHandler 2016-09-15 19:35:34 +03:00
Sdogruyol d4e96c7b44 Add spec for send_file binary 2016-08-08 21:49:47 +03:00
Sijawusz Pur Rahnama 31cc9fbff4 Add send_file helper variation for sending raw data (#188)
Add send_file helper variation for sending raw data

* Use Response#content_type=

* Fix docs
2016-08-08 21:15:43 +03:00
Sijawusz Pur Rahnama 4397a3c7fd Use Response#content_type= 2016-08-08 04:17:58 +02:00
Sdogruyol 5e297d86f8 Add send_file to helpers 2016-07-19 20:58:04 +03:00
Sdogruyol 725e051723 Document helpers 2016-07-17 17:06:49 +03:00
Sdogruyol f3175bdb72 Split helpers.cr into helpers/macros.cr and helpers/helpers.cr 2016-07-10 13:03:09 +03:00