Commit 41714c2
committed
[FAB-6355] Fix GetPrivateData() error on CouchDB
The problem was that the retrieve of the public
hash from couch state db fails due to a URL
encoding issue of a plus sign in the hashed key.
Keys were already URL encoded using golang URL
encoding, but the encoding skips plus signs in
the path component. CouchDB unencodes the plus
sign as a space.
The fix is to explicitly URL encode plus character
when interacting with CouchDB.
Also add unit test to verify the fix and test
all other URL special characters.
Also clarified the error message received when
private version does not match public hash.
Change-Id: I9b99d3446542e9eae0196158270205d3ea09db9f
Signed-off-by: David Enyeart <enyeart@us.ibm.com>1 parent dbe3c78 commit 41714c2
File tree
3 files changed
+29
-4
lines changed- core/ledger
- kvledger/txmgmt/txmgr/lockbasedtxmgr
- util/couchdb
3 files changed
+29
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
| 122 | + | |
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1407 | 1407 | | |
1408 | 1408 | | |
1409 | 1409 | | |
1410 | | - | |
1411 | | - | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
1412 | 1414 | | |
1413 | 1415 | | |
1414 | 1416 | | |
1415 | | - | |
| 1417 | + | |
1416 | 1418 | | |
| 1419 | + | |
1417 | 1420 | | |
1418 | 1421 | | |
1419 | 1422 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1130 | 1130 | | |
1131 | 1131 | | |
1132 | 1132 | | |
| 1133 | + | |
1133 | 1134 | | |
1134 | 1135 | | |
1135 | 1136 | | |
| |||
1166 | 1167 | | |
1167 | 1168 | | |
1168 | 1169 | | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
1169 | 1177 | | |
1170 | 1178 | | |
1171 | 1179 | | |
| |||
1188 | 1196 | | |
1189 | 1197 | | |
1190 | 1198 | | |
| 1199 | + | |
1191 | 1200 | | |
1192 | 1201 | | |
1193 | 1202 | | |
1194 | 1203 | | |
1195 | 1204 | | |
1196 | 1205 | | |
| 1206 | + | |
1197 | 1207 | | |
1198 | 1208 | | |
1199 | 1209 | | |
| |||
1214 | 1224 | | |
1215 | 1225 | | |
1216 | 1226 | | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
1217 | 1239 | | |
1218 | 1240 | | |
1219 | 1241 | | |
| |||
0 commit comments