token-validator: split rawHandler with responseHandler

This commit is contained in:
nemunaire 2020-03-01 18:09:20 +01:00
parent 8d55ecc3af
commit 09552ab516
3 changed files with 28 additions and 31 deletions

View file

@ -28,7 +28,7 @@ func init() {
func(httprouter.Params, []byte) (interface{}, error) {
return getStudentKeys()
}))
router.POST("/sshkeys", rawHandler(receiveKey))
router.POST("/sshkeys", rawHandler(responseHandler(receiveKey)))
router.GET("/sshkeys/authorizedkeys", func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
dumpAuthorizedKeysFile(w)
})