summaryrefslogtreecommitdiff
path: root/addons/web_linkedin/web_linkedin.py
diff options
context:
space:
mode:
authorAntony Lesuisse <al@openerp.com>2013-10-27 18:31:43 +0100
committerAntony Lesuisse <al@openerp.com>2013-10-27 18:31:43 +0100
commitd5b4cd627c16930bd6798768ccd77af2bfcb9f87 (patch)
tree3b7efbeecb6658506b1ad4b1ca6efafd7ef871b2 /addons/web_linkedin/web_linkedin.py
parent737586aa4e6f21540c8f18b8e02f2f9cd389021a (diff)
more controller conversion to new route api
bzr revid: al@openerp.com-20131027173143-tfxc7e7vqn7re6wb
Diffstat (limited to 'addons/web_linkedin/web_linkedin.py')
-rw-r--r--addons/web_linkedin/web_linkedin.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/addons/web_linkedin/web_linkedin.py b/addons/web_linkedin/web_linkedin.py
index 92adb30d3dd..a07dcd50ea0 100644
--- a/addons/web_linkedin/web_linkedin.py
+++ b/addons/web_linkedin/web_linkedin.py
@@ -26,13 +26,10 @@ from urlparse import urlparse, urlunparse
import openerp
from openerp.osv import fields, osv
-class Binary(openerp.addons.web.http.Controller):
- _cp_path = "/web_linkedin/binary"
-
- @openerp.addons.web.http.jsonrequest
- def url2binary(self, req, url):
+class Binary(openerp.http.Controller):
+ @openerp.http.route('/web_linkedin/binary/url2binary', type='json', auth='user')
+ def url2binary(self, url):
"""Used exclusively to load images from LinkedIn profiles, must not be used for anything else."""
- req.session.assert_valid(force=True)
_scheme, _netloc, path, params, query, fragment = urlparse(url)
# media.linkedin.com is the master domain for LinkedIn media (replicated to CDNs),
# so forcing it should always work and prevents abusing this method to load arbitrary URLs