mirror of https://github.com/rwf2/Rocket.git
Update fairings.md
This commit is contained in:
parent
92ce006e2c
commit
b191ebbd2a
|
@ -8,7 +8,7 @@ about incoming requests and outgoing responses.
|
||||||
|
|
||||||
Any type that implements the [`Fairing`] trait is a _fairing_. Fairings hook
|
Any type that implements the [`Fairing`] trait is a _fairing_. Fairings hook
|
||||||
into Rocket's request lifecycle, receiving callbacks for events such as incoming
|
into Rocket's request lifecycle, receiving callbacks for events such as incoming
|
||||||
requests and outgoing responses. Rocket passes information about these event to
|
requests and outgoing responses. Rocket passes information about these events to
|
||||||
the fairing, and the fairing can do what it wants with the information. This
|
the fairing, and the fairing can do what it wants with the information. This
|
||||||
includes rewriting data when applicable, recording information about the event
|
includes rewriting data when applicable, recording information about the event
|
||||||
or data, or doing nothing at all.
|
or data, or doing nothing at all.
|
||||||
|
@ -27,7 +27,7 @@ provides a rich set of mechanisms such as [request guards] and [data guards]
|
||||||
that can be used to solve problems in a clean, composable, and robust manner.
|
that can be used to solve problems in a clean, composable, and robust manner.
|
||||||
|
|
||||||
As a general rule of thumb, only _globally applicable_ actions should be
|
As a general rule of thumb, only _globally applicable_ actions should be
|
||||||
effected through fairings. You should _not_ use a fairing to implement
|
affected through fairings. You should _not_ use a fairing to implement
|
||||||
authentication or authorization (preferring to use a [request guard] instead)
|
authentication or authorization (preferring to use a [request guard] instead)
|
||||||
_unless_ the authentication or authorization applies to all or most of the
|
_unless_ the authentication or authorization applies to all or most of the
|
||||||
application. On the other hand, you _should_ use a fairing to record timing and
|
application. On the other hand, you _should_ use a fairing to record timing and
|
||||||
|
|
Loading…
Reference in New Issue