Closed Bug 1135582 Opened 10 years ago Closed 7 years ago

[js client] We should return 'undefined' when the content length is 0 or the content type is not json

Categories

(Taskcluster :: Services, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jhford, Unassigned)

References

Details

When the server sends us an empty repsonse, we should be returning undefined.
Component: TaskCluster → General
Product: Testing → Taskcluster
Component: General → Client Libraries
Commits pushed to master at https://github.com/taskcluster/taskcluster-client https://github.com/taskcluster/taskcluster-client/commit/e5a549bbedc769d305f55922ff881e7b071e32a6 Bug 1135582 Return undefined on empty response from server. modified: lib/client.js https://github.com/taskcluster/taskcluster-client/commit/1331e9fb12b6eca46c26dea8a5c9e7bd3173d031 Bug 1135582 Return undefined on empty response from server Returns undefined if response is empty or content-type is not application/json modified: lib/client.js https://github.com/taskcluster/taskcluster-client/commit/4ed666af1cc7df94ec77d4c020c3f19c15f1e3ab Merge pull request #46 from ckousik/undef Bug 1135582
This will be released with the next version... Thanks for the fix! :)
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
This doesn't return undefined -- it raises an exception. Which is not what we want, as we have lots of API methods that don't return a body or res['content-type']. With this change, we're getting `res.headers['content-type'] is null`. This has left the tools UI pretty broken.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Status: REOPENED → RESOLVED
Closed: 9 years ago7 years ago
Resolution: --- → FIXED
Component: Client Libraries → Services
You need to log in before you can comment on or make changes to this bug.