You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@zeppelin.apache.org by "JangAyeon (via GitHub)" <gi...@apache.org> on 2026/07/26 07:15:48 UTC
[PR] [ZEPPELIN-6522] Guard HTTP interceptor unwrap against null response bodies [zeppelin]
JangAyeon opened a new pull request, #5344:
URL: https://github.com/apache/zeppelin/pull/5344
### What is this PR for?
`AppHttpInterceptor.intercept` unwraps every `HttpResponse` as `event.body.body`, assuming the Zeppelin REST envelope (`{status, message, body}`). When `event.body` is `null` — a 204 No Content, or any empty 200 response — evaluating `event.body.body` throws `TypeError: Cannot read properties of null (reading 'body')`, which propagates to every subscriber of that request and turns an otherwise-successful empty response into a failure.
Non-enveloped JSON and `responseType: 'text'` responses were never affected `event.body.body` is `undefined` for them, and `HttpResponse.clone()` keeps the original body when the update body is `undefined`. The defect was specific to the null-body case.
This PR guards the unwrap on `event.body` being a non-null object that actually carries a `body` field; any other response (including null-body) now passes through `event.clone()` unchanged instead of touching `.body` on it.
### What type of PR is it?
Bug Fix
### Todos
* [x] Guard the unwrap so it only runs on a non-null object carrying a `body` field
* [x] Verify enveloped responses still unwrap correctly
* [x] Verify null-body responses pass through without throwing
### What is the Jira issue?
[ZEPPELIN-6522](https://issues.apache.org/jira/browse/ZEPPELIN-6522)
### How should this be tested?
* `cd zeppelin-web-angular && npm run lint`
* Feed the four body shapes (enveloped object, non-enveloped object, text string, null) through `event.clone({ body: event.body.body })` using a real `@angular/common/http` `HttpResponse`: before the fix, only the null case throws `TypeError: Cannot read properties of null (reading 'body')`; after the fix, all four pass through without throwing and the enveloped case still unwraps correctly.
### Questions:
* Does the license files need to update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? No
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@zeppelin.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [ZEPPELIN-6522] Guard HTTP interceptor unwrap against null response bodies [zeppelin]
Posted by "voidmatcha (via GitHub)" <gi...@apache.org>.
voidmatcha commented on PR #5344:
URL: https://github.com/apache/zeppelin/pull/5344#issuecomment-5105165553
Merged into master (dbb58f81).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@zeppelin.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [ZEPPELIN-6522] Guard HTTP interceptor unwrap against null response bodies [zeppelin]
Posted by "voidmatcha (via GitHub)" <gi...@apache.org>.
voidmatcha merged PR #5344:
URL: https://github.com/apache/zeppelin/pull/5344
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@zeppelin.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org