Reserved URLs clarification

112 views
Skip to first unread message

Alexander Konovalenko

unread,
Sep 19, 2011, 5:52:43 AM9/19/11
to Google App Engine group
The documentation [1] says the following URL paths are reserved:

/_ah/
/form

[1] http://code.google.com/appengine/docs/python/config/appconfig.html#Reserved_URLs

Now, it is clear from the actual use of the /_ah/ prefix that anything
that starts with /_ah/ is reserved. As for /form, there is room for
ambiguity here. Suppose an app is deployed on the www.example.com
Google Apps domain. Which of the following URLs are reserved?

(1) www.example.com/form
(2) www.example.com/form?var=value
(3) www.example.com/form/
(4) www.example.com/form/?var=value
(5) www.example.com/form/foo
(6) www.example.com/forms/bar
(7) www.example.com/formula

It looks like only (1) and (2) are reserved. If so, please update the
docs to make this distinction clear: any URL that *starts* with /_ah/
is reserved but only /form itself is reserved, and it is safe to use
any other URLs that start with /form.

By the way, why was /form reserved in the first place? It is a useful
URL and it would be nice to lift that limitation and move anything
that could possibly use it under /_ah/form. Reserving such a common
word is inelegant. In practice, migrating an existing app to App
Engine if the app has some important page at /form is impossible
because of that limitation. The original appname.com/form page could
be bookmarked or linked to from numerous places, and we can't even set
up a redirect to work around the problem.

Thanks.

Alexander

Tim Hoffman

unread,
Sep 19, 2011, 7:56:39 AM9/19/11
to google-a...@googlegroups.com
Hi Alexander

I think google are saying they are reserved as guide so you don't clash with some service of theirs, however I don't actually see 
any way of preventing you from using any of these paths in urls if you handling them yourself.

In my case I don't use webapp and don't only map a few of the _ah paths, and so my default handler gets all forms of /form as well as /_ah/* that don't match existing mapped handlers in app.yaml.

The danger is you prevent the access of some useful appengine service.

Rgds

Tim 

Alexander Konovalenko

unread,
Sep 19, 2011, 8:43:05 AM9/19/11
to google-a...@googlegroups.com, Tim Hoffman

Tim,

Thanks for your reponse.

Yes, for some /_ah/ paths, you're even supposed to handle them
yourself. For example, the Python warmup handler.

But I couldn't get my code to handle /form (not /form/ or
/form/something, but /form itself). Google's built-in handler always
takes precedence and returns a Google-branded 404 page with a nice
robot image. So the issue with /form is not theoretical.

What do you use /form for?

Regards,
Alexander

Tim Hoffman

unread,
Sep 19, 2011, 10:47:06 AM9/19/11
to Google App Engine
HI

Your right, I missed that specific case /form

Interesting, google are trapping that specific case before it even
gets to your instance.

It does seem somewhat arbitrary to intercept /form but /form/ gets
through
I am not sure those two are really different. (In fact I generally
allow both paths to resolve to the same
entity through traversal. )

I actually don't use /form for anything, all of my urls asentity
traversal oriented which means the url
generally starts with a an entity. (though in a cms you could call
any top level container or entity anything you want,
which could effectively hide a path, if a user accidentally called
something "form")

I did test but actually I realize now I typed /form/ not /form so I
missed the specific issue you raised, sorry.

Probably worth an new issue, asking for accurate documentation of the
url root paths that will not be passed through to
appengine apps.

Rgds

Tim


On Sep 19, 8:43 pm, Alexander Konovalenko <alex...@gmail.com> wrote:

Alexander Konovalenko

unread,
Oct 1, 2011, 1:52:38 PM10/1/11
to Google App Engine group
Filed an issue about this ambiguity. Please see
http://code.google.com/p/googleappengine/issues/detail?id=5983

-- Alexander

Reply all
Reply to author
Forward
0 new messages