@@ -519,7 +519,7 @@ server.route({
519
519
method: ' GET' ,
520
520
path: ' /' ,
521
521
handler : function (request , reply ) {
522
-
522
+
523
523
return reply (request .auth .credentials .user );
524
524
}
525
525
});
@@ -627,7 +627,7 @@ server.route({
627
627
config: {
628
628
auth: ' default' ,
629
629
handler : function (request , reply ) {
630
-
630
+
631
631
return reply (request .auth .credentials .user );
632
632
}
633
633
}
@@ -659,7 +659,7 @@ server.route({
659
659
method: ' GET' ,
660
660
path: ' /' ,
661
661
handler : function (request , reply ) {
662
-
662
+
663
663
request .server .auth .test (' default' , request, function (err , credentials ) {
664
664
665
665
if (err) {
@@ -753,7 +753,7 @@ Adds an incoming server connection where:
753
753
- ` address ` - sets the host name or IP address the connection will listen on. If not configured,
754
754
defaults to ` host ` if present, otherwise to all available network interfaces (i.e. ` '0.0.0.0' ` ).
755
755
Set to ` 127.0.0.1 ` or ` localhost ` to restrict connection to only those coming from the same
756
- machine.
756
+ machine.
757
757
- ` port ` - the TCP port the connection will listen to. Defaults to an ephemeral port (` 0 ` ) which
758
758
uses an available port when the server is started (and assigned to ` server.info.port ` ). If ` port `
759
759
is a string containing a '/' character, it is used as a UNIX domain socket path and if it starts
@@ -1448,7 +1448,7 @@ across multiple requests. Registers a cookie definitions where:
1448
1448
- ` 'base64' ` - string value is encoded using Base64.
1449
1449
- ` 'base64json' ` - object value is JSON-stringified than encoded using Base64.
1450
1450
- ` 'form' ` - object value is encoded using the _ x-www-form-urlencoded_ method.
1451
- - ` 'iron' ` - Encrypts and sign the value using
1451
+ - ` 'iron' ` - Encrypts and sign the value using
1452
1452
[ ** iron** ] ( https://github.com/hueniverse/iron ) .
1453
1453
- ` sign ` - an object used to calculate an HMAC for cookie integrity validation. This does not
1454
1454
provide privacy, only a mean to verify that the cookie value was generated by the server.
@@ -2527,18 +2527,18 @@ config to an object containing one of these keys:
2527
2527
value is the header content.
2528
2528
- ` onResponse ` - a custom function for processing the response from the upstream service
2529
2529
before sending to the client. Useful for custom error handling of responses from the
2530
- proxied endpoint or other payload manipulation. Function signature is
2530
+ proxied endpoint or other payload manipulation. Function signature is
2531
2531
` function(err, res, request, reply, settings, ttl) ` where:
2532
- - ` err ` - internal or upstream error returned from attempting to contact the upstream
2533
- proxy.
2534
- - ` res ` - the node response object received from the upstream service. ` res ` is a
2535
- readable stream (use the [ ** wreck** ] ( https://github.com/hapijs/wreck ) module ` read `
2536
- method to easily convert it to a Buffer or string).
2537
- - ` request ` - is the incoming [ request object] ( #request-object ) .
2538
- - ` reply ` - the [ reply interface] ( #reply-interface ) function.
2539
- - ` settings ` - the proxy handler configuration.
2540
- - ` ttl ` - the upstream TTL in milliseconds if ` proxy.ttl ` it set to ` 'upstream' ` and
2541
- the upstream response included a valid 'Cache-Control' header with 'max-age'.
2532
+ - ` err ` - internal or upstream error returned from attempting to contact the upstream
2533
+ proxy.
2534
+ - ` res ` - the node response object received from the upstream service. ` res ` is a
2535
+ readable stream (use the [ ** wreck** ] ( https://github.com/hapijs/wreck ) module ` read `
2536
+ method to easily convert it to a Buffer or string).
2537
+ - ` request ` - is the incoming [ request object] ( #request-object ) .
2538
+ - ` reply ` - the [ reply interface] ( #reply-interface ) function.
2539
+ - ` settings ` - the proxy handler configuration.
2540
+ - ` ttl ` - the upstream TTL in milliseconds if ` proxy.ttl ` it set to ` 'upstream' ` and
2541
+ the upstream response included a valid 'Cache-Control' header with 'max-age'.
2542
2542
- ` ttl ` - if set to ` 'upstream' ` , applies the upstream response caching policy to the
2543
2543
response using the ` response.ttl() ` method (or passed as an argument to the ` onResponse `
2544
2544
method if provided).
@@ -2911,7 +2911,7 @@ where:
2911
2911
- ` result ` - an optional response payload.
2912
2912
2913
2913
Since an request can only have one response regardless if it is an error or success, the ` reply() `
2914
- method can only result in a single response value. This means that passing both an ` err ` and
2914
+ method can only result in a single response value. This means that passing both an ` err ` and
2915
2915
` result ` will only use the ` err ` . There is no requirement for either ` err ` or ` result ` to be (or
2916
2916
not) an ` Error ` object. The framework will simply use the first argument if present, otherwise the
2917
2917
second. The method supports two arguments to be compatible with the common callback pattern of
0 commit comments