Ben Morrison
538e305925
updating module to live at sourcehut
...
Also moving the 'registry' library into this repo, rather
than maintaining them separately. It will still be decoupled,
just live in this repository.
2020-06-20 02:27:31 -04:00
Ben Morrison
3bb022fb6f
eliminated panic when serving requests from empty registry
...
when generating an etag from a query that returns no results,
indexing into the byte slice caused that thread to panic.
now checking for a nil byte slice or a small byte slice in
handlers.go:46:getEtag()
on nil byte slice, return empty string for etag. on small
byte slice, don't truncate it, but return the whole thing.
2020-03-16 14:49:06 -04:00
Ben Morrison
e53b843a93
some functions were missing comments. added those in where needed.
2019-12-19 21:21:56 -05:00
Ben Morrison
5631380067
truncating etag
2019-12-19 01:23:16 -05:00
Ben Morrison
04ad0e787a
minor refactor of apiEndpointHandler():
...
reduced early returns
removed unnecessary switch statement
2019-12-19 00:30:57 -05:00
Ben Morrison
982a521acd
refactored servStatic() to eliminate early return
2019-12-18 23:50:27 -05:00
Ben Morrison
efbc14fbc8
reduced size of hash for etag to 32bits
2019-12-18 23:42:15 -05:00
Ben Morrison
e79fa244cf
switched etags to use fnv hash
2019-12-12 02:08:14 -05:00
Ben Morrison
910e69ac1b
endpoint for version response
2019-08-28 16:10:01 -04:00
Ben Morrison
f13255f2e6
license notice at top of each file
2019-07-11 00:57:06 -04:00
Ben Morrison
d20ad73467
mutex and readability cleanup
2019-06-13 22:52:36 -04:00
Ben Morrison
979e1f93d5
separate request and message log
2019-06-12 21:20:04 -04:00
Ben Morrison
69adb2159f
cleaned up staticHandler
2019-06-11 20:10:58 -04:00
Ben Morrison
adee7fa633
runtime bugs in staticHandler
2019-06-11 20:02:45 -04:00
Ben Morrison
3da400b210
fixed content-types
2019-06-11 19:53:53 -04:00
Ben Morrison
6dad1372a4
check if behind reverse proxy
2019-06-11 18:14:07 -04:00
Ben Morrison
3d2994b74c
merged indexHandler with cssHandler, updated tests
2019-06-11 17:31:16 -04:00
Ben Morrison
824556ab98
refactored http err handling to combine 3 funcs into 1
2019-06-10 00:49:34 -04:00
Ben Morrison
a9d7d114e9
apiEndpointHandler now 404s invalid endpoints, better testing for it
2019-06-09 15:25:05 -04:00
Ben Morrison
78f4d8a6c1
sqlite functionality added
2019-06-08 02:29:28 -04:00
Ben Morrison
6c1b09bbeb
cleaned up error handling
2019-06-08 02:29:23 -04:00
Ben Morrison
e9d4a6b0e8
database refs and static assets concurrency-safe
2019-06-08 02:29:20 -04:00
Ben Morrison
eca8525e58
deduplicated duplicate deduplication functions
2019-06-06 02:22:56 -04:00
Ben Morrison
fd43c61bd1
moved bulk of code to its own package to clean up source tree
2019-06-05 15:36:23 -04:00