Commit Graph

16 Commits

Author SHA1 Message Date
Maxim Lebedev d3715c361c Used Headers constants instead raw strings 2019-05-28 18:04:24 +03:00
Maxim Lebedev f544170d63 Added methods constants (#567)
*  Added methods constants

* 👌 Fixed methods comment due to review changes
2019-05-06 17:54:49 +02:00
Shulhan 9574c37fb8 Various changes regarding code readibility (#523)
* all: use sort.Strings when applicable

Basically, sort.Strings is the shortcut of Sort(StringSlice(a)) but its
more readable.

* all: replace string(bytes.Buffer.Bytes()) with bytes.Buffer.String()

Although its only occured on test files, it may be worth to simplified it.

* http_test: simplify strings.Index with strings.Contains

Both have the same O(n), but strings.Contains more readable on
if-condition.

* args: simplify if-condition check on boolean value

* all: simplify variable initialization

If we assign the variable after declaring it, we can simplify it using
":=" operator or "= value".
The reader can still known the type of variable from the struct name or
variable type before assignment operator.
2019-02-02 11:13:33 +00:00
Erik Dubbelboer d53df67945 Fix Content-Type bug in FS
Fixes #417
2018-09-20 11:36:07 +08:00
Erik Dubbelboer e3fd87a866 Added PathNotFound handle func for handling 404.
See https://github.com/erikdubbelboer/fasthttp/pull/10
2018-08-17 15:51:44 +08:00
Victor Gaydov a0fe3404bf Add test for fsSmallFileReader.WriteTo and fix bug (#128)
The bug raises when io.Writer passed to fsSmallFileReader.WriteTo
doesn't support ReadFrom interface.
2016-07-12 09:42:39 +03:00
Aliaksandr Valialkin 6c5368b250 Issue #103: Added FS.CompressedFileSuffix and clarified FSHandlerCacheDuration documentation 2016-05-24 13:22:59 +03:00
Aliaksandr Valialkin 21a70cc5b8 reduced the time required to run tests with race detector enabled 2016-02-21 13:34:55 +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 e0cd149b5e Enabled virtual hosting support in example fileserver 2016-02-04 17:16:43 +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 4985a4c956 Improved ServeFile* tests 2016-01-18 07:23:48 +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 8a83396595 FS: added support for byte range requests 2016-01-05 14:05:07 +02:00
Aliaksandr Valialkin 9b8a7de66b Added transparent compression option to FS 2015-12-29 11:51:11 +02:00
Aliaksandr Valialkin ebf9968b68 Renamed fshandler to fs 2015-12-09 18:52:23 +02:00