Don't double prefix subproblem types (#4686)

Fixes #4682.
This commit is contained in:
Roland Bracewell Shoemaker 2020-02-27 09:43:20 -08:00 committed by GitHub
parent 9a86abc155
commit 87856371a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -61,7 +61,7 @@ func SendError(
// sub-problems // sub-problems
prob.Type = probs.ProblemType(namespace) + prob.Type prob.Type = probs.ProblemType(namespace) + prob.Type
for i := range prob.SubProblems { for i := range prob.SubProblems {
prob.SubProblems[i].Type = probs.ProblemType(namespace) + prob.Type prob.SubProblems[i].Type = prob.Type
} }
problemDoc, err := json.MarshalIndent(prob, "", " ") problemDoc, err := json.MarshalIndent(prob, "", " ")
if err != nil { if err != nil {

View File

@ -44,7 +44,7 @@ func TestSendErrorSubProblemNamespace(t *testing.T) {
"status": 400, "status": 400,
"subproblems": [ "subproblems": [
{ {
"type": "namespace:test:namespace:test:malformed", "type": "namespace:test:malformed",
"detail": "dfoop :: nop", "detail": "dfoop :: nop",
"status": 400, "status": 400,
"identifier": { "identifier": {
@ -53,7 +53,7 @@ func TestSendErrorSubProblemNamespace(t *testing.T) {
} }
}, },
{ {
"type": "namespace:test:namespace:test:malformed", "type": "namespace:test:malformed",
"detail": "dfoop :: nah", "detail": "dfoop :: nah",
"status": 400, "status": 400,
"identifier": { "identifier": {