Josh Bleecher Snyder
0868329936
all: use any instead of interface{}
...
My favorite part of generics.
Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
2022-03-17 11:35:09 -07:00
Brad Fitzpatrick
24c9dbd129
tsweb: fix JSONHandlerFunc regression where HTTP status was lost on gzip
...
Change-Id: Ia7add6cf7e8b46bb6dd45bd3c0371ea79402fb45
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2022-02-09 12:17:14 -08:00
Brad Fitzpatrick
df8f02db3f
tsweb: add gzip support to JSONHandlerFunc
...
Change-Id: I337e05f92f744bfc7e9d6fb8e67c87c191ba4da8
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2022-02-07 10:31:25 -08:00
chungdaniel
e7ac9a4b90
tsweb: refactor JSONHandler to take status code from error if it is present ( #905 )
...
This change is to make JSONHandler error handling intuitive, as before there would be two sources of HTTP status code when HTTPErrors were generated: one as the first return value of the handler function, and one nested inside the HTTPError. Previously, it took the first return value as the status code, and ignored the code inside the HTTPError. Now, it should expect the first return value to be 0 if there is an error, and it takes the status code of the HTTPError to set as the response code.
Signed-off-by: Daniel Chung <daniel@tailscale.com>
2020-11-10 09:52:26 -05:00
David Crawshaw
dea3ef0597
tsweb: make JSONHandlerFunc implement ReturnHandler, not http.Handler
...
This way something is capable of logging errors on the server.
Fixes #766
Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
2020-09-17 09:07:32 -04:00
halulu
1835bb6f85
tsweb: rewrite JSONHandler without using reflect ( #684 )
...
Closes #656 #657
Signed-off-by: Zijie Lu <zijie@tailscale.com>
2020-08-18 17:37:01 -04:00
Zijie Lu
c9e40abfb8
tsweb: jsonhandler: fix content type
...
Signed-off-by: Zijie Lu <zijie@tailscale.com>
2020-07-14 15:27:26 -04:00
Zijie Lu
d1a30be275
tsweb: JSONHandler: supports HTTPError
...
Signed-off-by: Zijie Lu <zijie@tailscale.com>
2020-06-09 17:40:45 -04:00
Zijie Lu
5e1ee4be53
tsweb: fix JSONHandler nil response
...
Signed-off-by: Zijie Lu <zijie@tailscale.com>
2020-06-08 15:48:38 -04:00
halulu
1d2e497d47
tsweb: JSONHandler using reflect ( #437 )
...
Updates #395 #437
Signed-off-by: Zijie Lu <zijie@tailscale.com>
2020-06-05 00:10:50 -04:00