@@ -1259,6 +1259,19 @@ bool Request::bodyAll(JSContext *cx, unsigned argc, JS::Value *vp) {
1259
1259
return RequestOrResponse::bodyAll<result_type>(cx, args, self);
1260
1260
}
1261
1261
1262
+ bool Request::backend_get (JSContext *cx, unsigned argc, JS::Value *vp) {
1263
+ METHOD_HEADER (0 )
1264
+ JS::RootedValue backend (
1265
+ cx, JS::GetReservedSlot (self, static_cast <uint32_t >(Slots::Backend)));
1266
+ if (backend.isNullOrUndefined ()) {
1267
+ args.rval ().setString (JS_GetEmptyString (cx));
1268
+ } else {
1269
+ args.rval ().set (backend);
1270
+ }
1271
+
1272
+ return true ;
1273
+ }
1274
+
1262
1275
bool Request::body_get (JSContext *cx, unsigned argc, JS::Value *vp) {
1263
1276
METHOD_HEADER (0 )
1264
1277
return RequestOrResponse::body_get (cx, args, self, is_downstream (self));
@@ -1313,6 +1326,12 @@ bool Request::clone(JSContext *cx, unsigned argc, JS::Value *vp) {
1313
1326
JS::SetReservedSlot (requestInstance, static_cast <uint32_t >(Slots::IsDownstream),
1314
1327
JS::GetReservedSlot (self, static_cast <uint32_t >(Slots::IsDownstream)));
1315
1328
1329
+ JS::RootedValue backend (
1330
+ cx, JS::GetReservedSlot (self, static_cast <uint32_t >(Slots::Backend)));
1331
+ if (!backend.isNullOrUndefined ()) {
1332
+ JS::SetReservedSlot (requestInstance, static_cast <uint32_t >(Slots::Backend), backend);
1333
+ }
1334
+
1316
1335
auto hasBody = RequestOrResponse::has_body (self);
1317
1336
1318
1337
JS::SetReservedSlot (requestInstance, static_cast <uint32_t >(Slots::HasBody),
@@ -1451,6 +1470,7 @@ const JSPropertySpec Request::properties[] = {
1451
1470
JS_PSG (" url" , Request::url_get, JSPROP_ENUMERATE),
1452
1471
JS_PSG (" version" , Request::version_get, JSPROP_ENUMERATE),
1453
1472
JS_PSG (" headers" , Request::headers_get, JSPROP_ENUMERATE),
1473
+ JS_PSG (" backend" , Request::backend_get, JSPROP_ENUMERATE),
1454
1474
JS_PSG (" body" , Request::body_get, JSPROP_ENUMERATE),
1455
1475
JS_PSG (" bodyUsed" , Request::bodyUsed_get, JSPROP_ENUMERATE),
1456
1476
JS_STRING_SYM_PS (toStringTag, " Request" , JSPROP_READONLY),
0 commit comments