braid-http 0.1.7 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/braid-http-server.js +3 -2
- package/package.json +1 -1
package/braid-http-server.js
CHANGED
|
@@ -285,8 +285,9 @@ function send_version(res, data, url, peer) {
|
|
|
285
285
|
if (Array.isArray(patches))
|
|
286
286
|
patches.forEach(p => assert(typeof p.content === 'string'))
|
|
287
287
|
}
|
|
288
|
-
|
|
289
|
-
assert(
|
|
288
|
+
var body_exists = body || body === ''
|
|
289
|
+
assert(body_exists || patches, 'Missing body or patches')
|
|
290
|
+
assert(!(body_exists && patches), 'Cannot send both body and patches')
|
|
290
291
|
|
|
291
292
|
// Write the headers or virtual headers
|
|
292
293
|
for (var [header, value] of Object.entries(data)) {
|