Class: DefaultRequestPlugin

DefaultRequestPlugin

The default values and methods injected into the request object.

Constructor

new DefaultRequestPlugin()

Source:

Members

acceptEncodings :Array.<String>

A list of encodings that the client accepts, most preffered first.
Type:
  • Array.<String>
Source:

acceptLanguages :Array.<String>

A list of languages that the client accepts, most preffered first.
Type:
  • Array.<String>
Source:

acceptTypes :Array.<String>

A list of content types that the client accepts, most preffered first.
Type:
  • Array.<String>
Source:

body :Buffer

The request body. Only guarenteed to be filled when the 'end' event is emitted.
Type:
  • Buffer
Source:

connectionIp :String

The connection IP address. Shorthand of req.connection.remoteAddress.
Type:
  • String
Source:

ip :String

The connection IP address, giving the X-Forwared-For header priority.
Type:
  • String
Source:

query :Object

A parsed version of req.url.query.
Type:
  • Object
Source:

secure :Boolean

true if the protocol is HTTPS, false otherwise.
Type:
  • Boolean
Source:

url :Object

A parsed version of req.url.
Type:
  • Object
Source:

Methods

accepts(contentType) → {Boolean}

Checks if a client accepts a specific content type.
Parameters:
Name Type Description
contentType String The type to check.
Source:
Returns:
true if the client does accept it, false otherwise.
Type
Boolean

acceptsEncoding(encoding) → {Boolean}

Checks if a client accepts a specific encoding.
Parameters:
Name Type Description
encoding String The encoding to check.
Source:
Returns:
true if the client does accept it, false otherwise.
Type
Boolean

acceptsLanguage(language) → {Boolean}

Checks if a client accepts a specific language.
Parameters:
Name Type Description
language String The language to check.
Source:
Returns:
true if the client does accept it, false otherwise.
Type
Boolean

Documentation generated by JSDoc 3.4.3 on Mon Aug 28 2017 19:55:09 GMT-0700 (PDT)