List Info

Thread: Removing extra parameters




Removing extra parameters
country flaguser name
Canada
2007-06-16 13:28:06
I'm having an annoying problem with extra parameters
being added to URL's. There's three cases I've
identified so far:

1. Some search engines that add various extra
parameters to the URLs (for example lpos=fromtheweb is
addded by Tiscalli search)
2. Certain web browsers on Symbian add extra fields to
form posts.
3. Google AdWords ads a gclid parameter

I could get round this by adding **kwargs to every
method but I'm just wondering if there's something
smarter I could do?

Thanks

Andrew

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-usersgooglegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribegooglegroups.com
For more options, visit this group at h
ttp://groups.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Removing extra parameters
country flaguser name
United Kingdom
2007-06-16 13:42:24
Well I guess the problem is that you can't foresee what kind
of 
parameters will be added by all the existing crawlers out
there.

I would try two approaches:

1. Write a tool (assuming you use CP3) that does some kind
of lookup of 
known added parameters and strip them out of the
cherrypy.request.params 
dict before they are passed to the page handler.

2. Write a decorator that does take a **kwargs and do some
page handler 
parameters discovery and strip out those that don't match
the page 
handler signature before calling the decorated callable (the
page 
handler itself).

I haven't tried any of those, it's just ideas here.

- Sylvain

Andrew Veitch a écrit :
> I'm having an annoying problem with extra parameters
> being added to URL's. There's three cases I've
> identified so far:
>
> 1. Some search engines that add various extra
> parameters to the URLs (for example lpos=fromtheweb is
> addded by Tiscalli search)
> 2. Certain web browsers on Symbian add extra fields to
> form posts.
> 3. Google AdWords ads a gclid parameter
>
> I could get round this by adding **kwargs to every
> method but I'm just wondering if there's something
> smarter I could do?
>
> Thanks
>
> Andrew
>
> >   


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-usersgooglegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribegooglegroups.com
For more options, visit this group at h
ttp://groups.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )