Created
July 29, 2014 15:26
-
-
Save cromulus/78536090b343e36c9fba to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@bp.route('lang',methods=['GET']) | |
def GET_lang(): | |
""" | |
Returns the language requested by the browser | |
defaults to en-US | |
""" | |
try: | |
headers = self.request.headers | |
return headers['Accept-Language'] || "en-US,en;q=0.8" | |
except Exceptions as e: | |
return respond500(e) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment