linkedin / linkedin/rest.li-test-suite
Content-Length headers in all the response files do not match the actual content length
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 3
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Description
All of the response files in the `client-testsuite/responses-v2` directory that have a non-empty body have a Content-Length header that does not actually indicate the right content length. It seems that the body of the responses was reformatted to be pretty printed but the header was not updated. For example, in [client-testsuite/responses-v2/collection-get.res](https://github.com/linkedin/rest.li-test-suite/blob/master/client-testsuite/responses-v2/collection-get.res), the contents look like this:
```
HTTP/1.1 200 OK
Content-Length: 33
Content-Type: application/json
X-RestLi-Protocol-Version: 2.0.0
{
"id" : 1,
"message" : "test message"
}
```
The real length of that message is actually 44 bytes. If the pretty formatting were undone, it would actually match the declared length.
Here is the full report of the byte differences in the files I tested:
```
utils.go:75: Content-Length header in rest.li-test-suite/client-testsuite/responses-v2/collectionReturnEntity-create.res indicates 26 bytes, but body was 32 bytes
utils.go:75: Content-Length header in rest.li-test-suite/client-testsuite/responses-v2/collection-get.res indicates 33 bytes, but body was 44 bytes
utils.go:75: Content-Length header in rest.li-test-suite/client-testsuite/responses-v2/collection-batch-get.res indicates 118 bytes, but body was 199 bytes
utils.go:75: Content-Length header in rest.li-test-suite/client-testsuite/responses-v2/collection-batch-create.res indicates 116 bytes, but body was 173 bytes
utils.go:75: Content-Length header in rest.li-test-suite/client-testsuite/responses-v2/collection-batch-update.res indicates 63 bytes, but body was 120 bytes
utils.go:75: Content-Length header in rest.li-test-suite/client-testsuite/responses-v2/collection-batch-partial-update.res indicates 63 bytes, but body was 120 bytes
utils.go:75: Content-Length header in rest.li-test-suite/client-testsuite/responses-v2/collection-batch-delete.res indicates 63 bytes, but body was 120 bytes
utils.go:75: Content-Length header in rest.li-test-suite/client-testsuite/responses-v2/collection-get-projection.res indicates 8 bytes, but body was 14 bytes
utils.go:75: Content-Length header in rest.li-test-suite/client-testsuite/responses-v2/collection-get-404.res indicates 4205 bytes, but body was 4208 bytes
utils.go:75: Content-Length header in rest.li-test-suite/client-testsuite/responses-v2/collection-update-400.res indicates 4116 bytes, but body was 4137 bytes
utils.go:75: Content-Length header in rest.li-test-suite/client-testsuite/responses-v2/collection-create-500.res indicates 4271 bytes, but body was 4292 bytes
utils.go:75: Content-Length header in rest.li-test-suite/client-testsuite/responses-v2/collection-create-error-details.res indicates 4130 bytes, but body was 4173 bytes
utils.go:75: Content-Length header in rest.li-test-suite/client-testsuite/responses-v2/collection-batch-update-errors.res indicates 8360 bytes, but body was 8485 bytes
utils.go:75: Content-Length header in rest.li-test-suite/client-testsuite/responses-v2/sub-collection-of-collection-get.res indicates 45 bytes, but body was 56 bytes
utils.go:75: Content-Length header in rest.li-test-suite/client-testsuite/responses-v2/sub-simple-of-collection-get.res indicates 32 bytes, but body was 38 bytes
utils.go:75: Content-Length header in rest.li-test-suite/client-testsuite/responses-v2/collection-search-finder.res indicates 196 bytes, but body was 298 bytes
utils.go:75: Content-Length header in rest.li-test-suite/client-testsuite/responses-v2/complexkey-get.res indicates 86 bytes, but body was 131 bytes
utils.go:75: Content-Length header in rest.li-test-suite/client-testsuite/responses-v2/complexkey-get-projection.res indicates 14 bytes, but body was 21 bytes
utils.go:75: Content-Length header in rest.li-test-suite/client-testsuite/responses-v2/complexkey-batch-get.res indicates 283 bytes, but body was 480 bytes
utils.go:75: Content-Length header in rest.li-test-suite/client-testsuite/responses-v2/complexkey-batch-create.res indicates 44 bytes, but body was 73 bytes
utils.go:75: Content-Length header in rest.li-test-suite/client-testsuite/responses-v2/complexkey-batch-update.res indicates 124 bytes, but body was 181 bytes
utils.go:75: Content-Length header in rest.li-test-suite/client-testsuite/responses-v2/complexkey-batch-delete.res indicates 124 bytes, but body was 181 bytes
utils.go:75: Content-Length header in rest.li-test-suite/client-testsuite/responses-v2/complexkey-get-with-special-chars.res indicates 106 bytes, but body was 151 bytes
utils.go:75: Content-Length header in rest.li-test-suite/client-testsuite/responses-v2/complexkey-batch-get-with-special-chars.res indicates 333 bytes, but body was 530 bytes
utils.go:75: Content-Length header in rest.li-test-suite/client-testsuite/responses-v2/association-get.res indicates 87 bytes, but body was 132 bytes
utils.go:75: Content-Length header in rest.li-test-suite/client-testsuite/responses-v2/association-batch-get.res indicates 285 bytes, but body was 482 bytes
utils.go:75: Content-Length header in rest.li-test-suite/client-testsuite/responses-v2/association-batch-update.res indicates 125 bytes, but body was 182 bytes
utils.go:75: Content-Length header in rest.li-test-suite/client-testsuite/responses-v2/association-batch-delete.res indicates 125 bytes, but body was 182 bytes
utils.go:75: Content-Length header in rest.li-test-suite/client-testsuite/responses-v2/association-assoc-key-finder.res indicates 318 bytes, but body was 547 bytes
utils.go:75: Content-Length header in rest.li-test-suite/client-testsuite/responses-v2/simple-get.res indicates 26 bytes, but body was 32 bytes
utils.go:75: Content-Length header in rest.li-test-suite/client-testsuite/responses-v2/actionset-echo.res indicates 33 bytes, but body was 39 bytes
utils.go:75: Content-Length header in rest.li-test-suite/client-testsuite/responses-v2/actionset-return-int.res indicates 12 bytes, but body was 18 bytes
utils.go:75: Content-Length header in rest.li-test-suite/client-testsuite/responses-v2/actionset-return-bool.res indicates 14 bytes, but body was 20 bytes
utils.go:75: Content-Length header in rest.li-test-suite/client-testsuite/responses-v2/actionset-echo-message.res indicates 36 bytes, but body was 52 bytes
utils.go:75: Content-Length header in rest.li-test-suite/client-testsuite/responses-v2/actionset-echo-message-array.res indicates 68 bytes, but body was 97 bytes
utils.go:75: Content-Length header in rest.li-test-suite/client-testsuite/responses-v2/actionset-echo-string-array.res indicates 37 bytes, but body was 46 bytes
utils.go:75: Content-Length header in rest.li-test-suite/client-testsuite/responses-v2/actionset-echo-string-map.res indicates 49 bytes, but body was 72 bytes
utils.go:75: Content-Length header in rest.li-test-suite/client-testsuite/responses-v2/actionset-echo-typeref-url.res indicates 26 bytes, but body was 32 bytes
utils.go:75: Content-Length header in rest.li-test-suite/client-testsuite/responses-v2/actionset-echo-primitive-union.res indicates 42 bytes, but body was 72 bytes
utils.go:75: Content-Length header in rest.li-test-suite/client-testsuite/responses-v2/actionset-echo-complex-types-union.res indicates 59 bytes, but body was 89 bytes
utils.go:75: Content-Length header in rest.li-test-suite/client-testsuite/responses-v2/actionset-multiple-inputs.res indicates 14 bytes, but body was 20 bytes
utils.go:75: Content-Length header in rest.li-test-suite/client-testsuite/responses-v2/actionset-multiple-inputs-no-optional.res indicates 14 bytes, but body was 20 bytes
utils.go:75: Content-Length header in rest.li-test-suite/client-testsuite/responses-v2/keywithunion-get.res indicates 86 bytes, but body was 131 bytes
utils.go:75: Content-Length header in rest.li-test-suite/client-testsuite/responses-v2/params-get-with-queryparams.res indicates 33 bytes, but body was 44 bytes
utils.go:75: Content-Length header in rest.li-test-suite/client-testsuite/responses-v2/collection-typeref-get.res indicates 26 bytes, but body was 32 bytes
utils.go:75: Content-Length header in rest.li-test-suite/client-testsuite/responses-v2/association-typeref-get.res indicates 26 bytes, but body was 32 bytes
```
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Inspect the listed fixtures under client-testsuite/responses-v2 and the byte-count validation reported at utils.go:75. Update each non-empty response's Content-Length to match its actual body bytes, then rerun the validation to confirm that no mismatches remain.
Written by the indexing model from the issue text.
Assessment
- Domain
- testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100