forked from TrueCloudLab/certificates
Fix SCEP GET requests
This commit is contained in:
parent
88a1bf17cf
commit
13173ec8a2
1 changed files with 3 additions and 3 deletions
|
@ -86,7 +86,7 @@ func (h *handler) Get(w http.ResponseWriter, r *http.Request) {
|
||||||
case opnGetCACaps:
|
case opnGetCACaps:
|
||||||
res, err = h.GetCACaps(ctx)
|
res, err = h.GetCACaps(ctx)
|
||||||
case opnPKIOperation:
|
case opnPKIOperation:
|
||||||
// TODO: implement the GET for PKI operation? Default CACAPS doesn't specify this is in use, though
|
res, err = h.PKIOperation(ctx, req)
|
||||||
default:
|
default:
|
||||||
err = fmt.Errorf("unknown operation: %s", req.Operation)
|
err = fmt.Errorf("unknown operation: %s", req.Operation)
|
||||||
}
|
}
|
||||||
|
@ -151,8 +151,8 @@ func decodeRequest(r *http.Request) (request, error) {
|
||||||
if _, ok := query["message"]; ok {
|
if _, ok := query["message"]; ok {
|
||||||
message = query.Get("message")
|
message = query.Get("message")
|
||||||
}
|
}
|
||||||
// TODO: verify this; it seems like it should be StdEncoding instead of URLEncoding
|
// TODO: verify this; right type of encoding? Needs additional transformations?
|
||||||
decodedMessage, err := base64.URLEncoding.DecodeString(message)
|
decodedMessage, err := base64.StdEncoding.DecodeString(message)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return request{}, err
|
return request{}, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue