You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2019/07/11 00:39:24 UTC

[GitHub] [incubator-superset] graceguo-supercat commented on a change in pull request #7840: update shortner endpoint to look at request headers origin instead of host

graceguo-supercat commented on a change in pull request #7840: update shortner endpoint to look at request headers origin instead of host
URL: https://github.com/apache/incubator-superset/pull/7840#discussion_r302324747
 
 

 ##########
 File path: superset/views/core.py
 ##########
 @@ -1008,7 +1008,7 @@ def shortner(self):
         db.session.add(obj)
         db.session.commit()
         return Response(
-            "{scheme}://{request.headers[Host]}/r/{obj.id}".format(
+            "{request.headers[origin]}/r/{obj.id}".format(
 
 Review comment:
   I am ok to use `ORIGIN` instead of `HOST`, why remove `{scheme}` part?
   
   Also please check the error message in unit test, you probably need to find a way to get HTTP_ORIGIN header

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org