[p2pu-dev] Redirection for API calls to an API_SERVER

Dan Diebolt dandiebolt at gmail.com
Wed May 16 14:24:50 UTC 2012


If you use a different domain or subdomain for the API endpoint you will
not be able to call some API methods and consume the response from client
side code because of the same origin policy. Admittedly the API may not
currently have methods you want to call client side nor is there any way
for a end user to create client side javascript but if you offer these
capabilities in the future you don't want to the same origin policy block
those efforts.

On Wed, May 16, 2012 at 6:29 AM, Jos Flores <josmasflores at gmail.com> wrote:

> Hey guys,
>
> I have added a setting API_SERVER to be able to redirect calls to the
> API to a different machine if that setting is != None
>
> Could you guys have a look at the commit here:
>
> https://github.com/josmas/lernanta/commit/9ad44ffcc501bd8d4f5810e7b6deace95ff2a9a8
>
> Regarding a previous comment by Zuzel (not sure you are still around?)
> here:
> https://github.com/josmas/lernanta/commit/7f59a769581f2607c883db7dc0e1672fecc80faa#commitcomment-1227108
>
> I've decided against 404-ing p2pu.org/api because in that case we
> could not serve the API and the site under the same domain. API_SERVER
> is there for flexibility but I think for now we will be serving
> everything off the same server so we cannot 404 local calls.
>
> Could you guys let me know if you are happy with this and I will send
> a pull request? Any feedback appreciated!
>
> cheers,
> José
> _______________________________________________
> p2pu-dev mailing list
> p2pu-dev at lists.p2pu.org
> http://lists.p2pu.org/mailman/listinfo/p2pu-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p2pu.org/pipermail/p2pu-dev/attachments/20120516/4c719315/attachment.html>


More information about the p2pu-dev mailing list