@@ -278,6 +278,7 @@ class Server
278
278
# }
279
279
280
280
props = _ .extend ({}, {
281
+ auth : @_remoteAuth
281
282
props : @_remoteProps
282
283
origin : @_remoteOrigin
283
284
strategy : @_remoteStrategy
@@ -294,6 +295,12 @@ class Server
294
295
@_request .send (headers, automationRequest, options)
295
296
296
297
_onResolveUrl : (urlStr , headers , automationRequest , options = {}) ->
298
+ debug (" resolving visit" , {
299
+ url : urlStr
300
+ headers
301
+ options
302
+ })
303
+
297
304
request = @_request
298
305
299
306
handlingLocalFile = false
@@ -327,7 +334,7 @@ class Server
327
334
328
335
@_remoteVisitingUrl = true
329
336
330
- @ _onDomainSet (urlStr)
337
+ @ _onDomainSet (urlStr, options )
331
338
332
339
# # TODO: instead of joining remoteOrigin here
333
340
# # we can simply join our fileServer origin
@@ -396,7 +403,7 @@ class Server
396
403
if isOk and isHtml
397
404
# # reset the domain to the new url if we're not
398
405
# # handling a local file
399
- @ _onDomainSet (newUrl) if not handlingLocalFile
406
+ @ _onDomainSet (newUrl, options ) if not handlingLocalFile
400
407
401
408
buffers .set ({
402
409
url : newUrl
@@ -415,6 +422,7 @@ class Server
415
422
.pipe (stream .PassThrough ())
416
423
417
424
restorePreviousState = =>
425
+ @_remoteAuth = previousState .auth
418
426
@_remoteProps = previousState .props
419
427
@_remoteOrigin = previousState .origin
420
428
@_remoteStrategy = previousState .strategy
@@ -425,6 +433,7 @@ class Server
425
433
request .sendStream (headers, automationRequest, {
426
434
# # turn off gzip since we need to eventually
427
435
# # rewrite these contents
436
+ auth : options .auth
428
437
gzip : false
429
438
url : urlFile ? urlStr
430
439
headers : {
@@ -445,9 +454,13 @@ class Server
445
454
.then (handleReqStream)
446
455
.catch (error)
447
456
448
- _onDomainSet : (fullyQualifiedUrl ) ->
449
- l = (type , url ) ->
450
- debug (" Setting %s %s" , type, url)
457
+ _onDomainSet : (fullyQualifiedUrl , options = {}) ->
458
+ l = (type , val ) ->
459
+ debug (" Setting" , type, val)
460
+
461
+ @_remoteAuth = options .auth
462
+
463
+ l (" remoteAuth" , @_remoteAuth )
451
464
452
465
# # if this isn't a fully qualified url
453
466
# # or if this came to us as <root> in our tests
0 commit comments