-
Notifications
You must be signed in to change notification settings - Fork 0
How a Request is Processed
AnotherKamila edited this page Sep 1, 2012
·
2 revisions
This is what happens to a request when it is received:
-
Find out if this URL exists
Match this URL against the set of URL patterns in the system. If there is no match, return a404 Not Foundresponse and end processing, otherwise continue. -
Attempt to determine an authenticated user
If this succeeds, theuserproperty on the request object is set to the authenticated user, otherwise it is set to the default user. -
Find out whether the current user is allowed to perform the requested operation
Determined according to the access rules; if not allowed, reply with the appropriate response code (401 Unauthorizedor404 Not Founddepending on the visibility of the object) and end request processing -
perform the requested operation
The result is a response object containing the status code, optional headers, and body content (an object, which will be rendered as in point 4) -
render the response
The following is taken into account when determining how to render it, in order of decreasing priority:- the
formatorlangquery parameter in the URL - a
formatorlangcookie - the request
AcceptorAccept-Languageheaders (processed according to the RFC2616)
Note: if too many browsers send too evilAcceptheaders, I may decide to disregard it. - defaults:
format=html, lang=en
- the
After the response is rendered, processing ends.