ÿØÿàJFIFÿþ ÿÛC       ÿÛC ÿÀÿÄÿÄ"#QrÿÄÿÄ&1!A"2qQaáÿÚ ?Øy,æ/3JæÝ¹È߲؋5êXw²±ÉyˆR”¾I0ó2—PI¾IÌÚiMö¯–þrìN&"KgX:Šíµ•nTJnLK„…@!‰-ý ùúmë;ºgµŒ&ó±hw’¯Õ@”Ü— 9ñ-ë.²1<yà‚¹ïQÐU„ہ?.’¦èûbß±©Ö«Âw*VŒ) `$‰bØÔŸ’ëXÖ-ËTÜíGÚ3ð«g Ÿ§¯—Jx„–’U/ÂÅv_s(Hÿ@TñJÑãõçn­‚!ÈgfbÓc­:él[ðQe 9ÀPLbÃãCµm[5¿ç'ªjglå‡Ûí_§Úõl-;"PkÞÞÁQâ¼_Ñ^¢SŸx?"¸¦ùY騐ÒOÈ q’`~~ÚtËU¹CڒêV  I1Áß_ÿÙ Yc@@sfdZddlmZddlmZmZdZdZdZe e e dZ dZ d S( s This module implements WSGI related helpers adapted from ``werkzeug.wsgi`` :copyright: (c) 2010 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. i(tabsolute_import(t iteritemst urllib_quotecc@sxt|D]\}}t|}|jdrd|d krd|djddj|fVq |d kr |jddj|fVq q Wd S( s+ Returns only proper HTTP headers. tHTTP_tHTTP_CONTENT_TYPEtHTTP_CONTENT_LENGTHit_t-t CONTENT_TYPEtCONTENT_LENGTHN(RR(RR (Rtstrt startswithtreplacettitle(tenvirontkeytvalue((sA/opt/alt/python27/lib/python2.7/site-packages/raven/utils/wsgi.pyt get_headers s  $ cc@s3x,dD]$}||kr|||fVqqWdS(s8 Returns our whitelisted environment variables. t REMOTE_ADDRt SERVER_NAMEt SERVER_PORTN(RRR((RR((sA/opt/alt/python27/lib/python2.7/site-packages/raven/utils/wsgi.pyt get_environs  cC@s|jd}d|kr(|d}nZd|krA|d}nA|d}|t|dfddfkr|d |d7}n|jd r|dkr|d }n(|jd r|dkr|d }n|S(sReturn the real host for the given WSGI environment. This takes care of the `X-Forwarded-Host` header. :param environ: the WSGI environment to get the host of. swsgi.url_schemetHTTP_X_FORWARDED_HOSTt HTTP_HOSTRRthttpst443thttpt80t:s:80is:443i(RR(RR(tgetR tendswith(Rtschemetresult((sA/opt/alt/python27/lib/python2.7/site-packages/raven/utils/wsgi.pytget_host$s       cC@s|ddt|g}|j}|r9dj|dS|t|jddjd|rq|dnX|td|jddjd|s|jd}|r|d|qndj|S( s3A handy helper function that recreates the full URL for the current request or parts of it. Here an example: >>> from werkzeug import create_environ >>> env = create_environ("/?param=foo", "http://localhost/script") >>> get_current_url(env) 'http://localhost/script/?param=foo' >>> get_current_url(env, root_only=True) 'http://localhost/script/' >>> get_current_url(env, host_only=True) 'http://localhost/' >>> get_current_url(env, strip_querystring=True) 'http://localhost/script/' :param environ: the WSGI environment to get the current URL from. :param root_only: set `True` if you only want the root URL. :param strip_querystring: set to `True` if you don't want the querystring. :param host_only: set to `True` if the host URL should be returned. swsgi.url_schemes://tt/t SCRIPT_NAMEt PATH_INFOt QUERY_STRINGt?(R!tappendtjoinRRtrstriptlstrip(Rt root_onlytstrip_querystringt host_onlyttmptcattqs((sA/opt/alt/python27/lib/python2.7/site-packages/raven/utils/wsgi.pytget_current_url<s % )cC@sGy|djddjSWn!ttfk rB|jdSXdS(s Naively yank the first IP address in an X-Forwarded-For header and assume this is correct. Note: Don't use this in security sensitive situations since this value may be forged from a client. tHTTP_X_FORWARDED_FORt,iRN(tsplittstriptKeyErrort IndexErrorR(R((sA/opt/alt/python27/lib/python2.7/site-packages/raven/utils/wsgi.pyt get_client_ipasN( t__doc__t __future__Rtraven.utils.compatRRRRR!tFalseR2R9(((sA/opt/alt/python27/lib/python2.7/site-packages/raven/utils/wsgi.pyts  $