Commit Graph

43 Commits

Author SHA1 Message Date
Aliaksandr Valialkin 0d43464f64 Renamed unsafeBytes2Str to b2s 2016-03-29 16:26:21 +03:00
Aliaksandr Valialkin 9ad70994bb code cleanup: removed duplicate code in fs.go 2016-03-21 18:42:34 +02:00
Aliaksandr Valialkin 76e0faee32 Added anti-copy guard to FS type 2016-03-06 19:12:00 +02:00
Aliaksandr Valialkin 3e83cf1c27 Properly handle missing file error in ServeFile 2016-02-29 14:45:42 +02:00
Aliaksandr Valialkin 68c6a4f496 Added ServeFileBytes* and RequestCtx.SendFileBytes* helper functions 2016-02-29 14:42:55 +02:00
Aliaksandr Valialkin 9f608dd1fd Issue #51: Make RequestCtx.SendFile a synonim to ServeFile. This breaks RequestCtx.SendFile API, but I believe the new behaviour of SendFile outweights API breakage 2016-02-17 11:35:36 +02:00
Aliaksandr Valialkin 87628147e5 Use zero-alloc copy instead of io.Copy 2016-02-13 11:01:18 +02:00
Aliaksandr Valialkin 9c9b5abffa Documentation update according to golint 2016-02-12 17:47:57 +02:00
Aliaksandr Valialkin 80368e6491 Switch from bytes.Buffer to ByteBuffer where appropriate 2016-02-12 14:07:56 +02:00
Aliaksandr Valialkin 0aec76fa1f code cleanup 2016-02-11 19:32:38 +02:00
Aliaksandr Valialkin 8757b644eb Exported ByteBuffer 2016-02-11 12:12:37 +02:00
Aliaksandr Valialkin bb2a414fe8 Issues #14, #46: use @klauspost 's compress library instead of standard compress/*, since it provides better performance on average 2016-02-10 16:40:14 +02:00
Aliaksandr Valialkin e72e899aa3 Issue #47: allow out-of range offsets in byte range headers according to RFC 2616 2016-02-08 16:21:49 +02:00
Aliaksandr Valialkin 913d03cc84 Do not allocate memory when constructing path inside VHostPathRewriter 2016-02-05 13:00:52 +02:00
Aliaksandr Valialkin e0cd149b5e Enabled virtual hosting support in example fileserver 2016-02-04 17:16:43 +02:00
Aliaksandr Valialkin 5dff324211 FS: verify that the path doesn't contain '/../' only if PathRewriter is used 2016-02-04 16:44:07 +02:00
Aliaksandr Valialkin f36c218b13 FS: make sure that the path returned from PathRewriteFunc doesn't contain '/../' due to security reasons 2016-02-04 16:38:24 +02:00
Aliaksandr Valialkin 33e5464e41 fs: allow multiple calls to FS.NewRequestHandler() 2016-02-03 11:07:45 +02:00
Aliaksandr Valialkin b127e96399 FS: reset response body on HEAD request 2016-01-20 13:27:22 +02:00
Aliaksandr Valialkin a208149ac4 FS optimization: do not read file contents on HEAD requests 2016-01-18 20:40:43 +02:00
Aliaksandr Valialkin 764a74e2ec Added ServeFile and ServeFileUncompressed to be on par with net/http 2016-01-17 23:12:38 +02:00
Aliaksandr Valialkin 414149027d gofmt 2016-01-08 13:39:51 +02:00
Aliaksandr Valialkin 56a0483095 FS: limit maximum file size, which can be compressed 2016-01-08 12:57:42 +02:00
Aliaksandr Valialkin bbb68f32d1 FS: reduced miminum compression ratio for triggering response compression. This should reduce CPU usage for files with low compression ratio 2016-01-08 12:52:35 +02:00
Aliaksandr Valialkin da62899f14 Removed obsolete startPos verification 2016-01-05 14:22:17 +02:00
Aliaksandr Valialkin 8a83396595 FS: added support for byte range requests 2016-01-05 14:05:07 +02:00
Aliaksandr Valialkin 4bca54c0bb Issue #29: use time.UTC instead of time.LoadLocation, since this call may fail on systems without certain config files 2016-01-04 15:55:30 +02:00
Aliaksandr Valialkin 8b38f99229 FS: correctly detect content-type for transparently compressed files 2015-12-30 15:27:54 +02:00
Aliaksandr Valialkin c20fff55a6 FS: detect file content-type with net/http.DetectContentType if the type cannot be determined by file extension 2015-12-30 15:13:50 +02:00
Aliaksandr Valialkin 0d58868d33 FS: do not show compressed files ending with .fasthttp.gz in automatically generated directory index 2015-12-30 14:39:39 +02:00
Aliaksandr Valialkin 58ff6e004c code cleanup: removed unused pendingFiles member from fsHandler 2015-12-30 13:36:33 +02:00
Aliaksandr Valialkin b28a765ded Emit log warning if FS request handler has no permissions for creating compressed file 2015-12-29 12:14:50 +02:00
Aliaksandr Valialkin 9b8a7de66b Added transparent compression option to FS 2015-12-29 11:51:11 +02:00
Aliaksandr Valialkin d2db95337f Removed 'v interface{}' hack from structs managed via sync.Pool, since it has no sense 2015-12-23 11:39:40 +02:00
Aliaksandr Valialkin d54fa3f450 FS: parent path fix 2015-12-20 02:15:23 +02:00
Aliaksandr Valialkin cc54f8f447 FS: properly generate parent path 2015-12-20 02:08:46 +02:00
Aliaksandr Valialkin 2771603952 FS: show file modification time in GMT tz and truncate it to seconds 2015-12-20 02:00:54 +02:00
Aliaksandr Valialkin f94be39128 FS: make directory names bold on index pages 2015-12-20 01:52:41 +02:00
Aliaksandr Valialkin 3553e250c9 Use utf-8 charset for directory index generated by FS* 2015-12-20 01:26:41 +02:00
Aliaksandr Valialkin 22a408b7fb fs: decrement readers count if the file wasn't modified 2015-12-10 08:41:08 +02:00
Aliaksandr Valialkin 9c18f79145 Added support for If-Modified-Since to SendFile and FS 2015-12-09 18:51:51 +02:00
Aliaksandr Valialkin f94e6ce77e Eliminated data race with readersCount 2015-12-09 14:02:09 +02:00
Aliaksandr Valialkin 2763d42da1 Renamed fshandler.go to fs.go 2015-12-09 14:01:39 +02:00