Commit 305bfd9
committed
fix(http4s): keep raw 400 for Old-Style versions in ErrorResponseConverter
`resolveStatusCode` was promoting any 400 with an OBP-XXXXX prefix to the
canonical status code via `ErrorMessages.getCodeByOBPPrefix` (403 for
UserNoPermissionAccessView, etc.). That broke v1.2.1's 4 "view doesn't
exist" / "missing token" / "user lacks privileges" tests in API1_2_1Test
that assert 400, because Old-Style versions (v1.x, v2.0.0) never promote
to 401/403 — they return 400 for every error per the long-standing OBP
convention (same set ResourceDocMiddleware.authenticate honours).
Guard the translation with the same oldStyleShortVersions set so v1.2.1
gets 400 and v2.1.0+ still gets the canonical code (DoubleEntryTransaction
v4 test still passes with 403 for UserNoPermissionAccessView).
Verified: API1_2_1Test 323/323 pass, DoubleEntryTransactionTest 4/4 pass.1 parent 0281423 commit 305bfd9
1 file changed
Lines changed: 11 additions & 4 deletions
Lines changed: 11 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
88 | 93 | | |
89 | 94 | | |
90 | 95 | | |
91 | 96 | | |
92 | | - | |
| 97 | + | |
| 98 | + | |
93 | 99 | | |
94 | | - | |
95 | | - | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
96 | 103 | | |
97 | 104 | | |
98 | 105 | | |
99 | 106 | | |
100 | 107 | | |
101 | 108 | | |
102 | 109 | | |
103 | | - | |
| 110 | + | |
104 | 111 | | |
105 | 112 | | |
106 | 113 | | |
| |||
0 commit comments