-
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, the
userproperty on the request object is set to the authenticated user - if this fails, the
userproperty is set to the default user
- if this succeeds, the
-
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
- the following is taken into account when determining how to render it, in order of decreasing priority:
After the response is rendered, processing ends.