You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 28, 2024. It is now read-only.
pnp.sp.crossDomainWeb(this.sharePointConfigService.addInWebUrl, this.sharePointConfigService.hostWebUrl).getFileByServerRelativeUrl(serverRelativeUrl).setContent(content); should update the content of the file without throwing an exception.
Category
[ ] Enhancement
[ *] Bug
[ ] Question
Expected / Desired Behavior / Question
pnp.sp.crossDomainWeb(this.sharePointConfigService.addInWebUrl, this.sharePointConfigService.hostWebUrl).getFileByServerRelativeUrl(serverRelativeUrl).setContent(content); should update the content of the file without throwing an exception.
Observed Behavior
ConvertToResponse in this file, https://github.com/SharePoint/PnP-JS-Core/blob/master/src/net/sprequestexecutorclient.ts, throws an exception in chrome because the body is "" when it should be null when the status is 204. Not sure if this should be considered as a bug in pnp-js-core or SP.RequestExecutor.js.
I solved it temporarily with this code:
var body = spResponse.statusCode === 204 && spResponse.body === "" ? null : spResponse.body;