Maybe that will work... I may look into it later.
Sorry I should have been more clear...
My app sits behind load balancers/webservers which do url rewriting.
different domains can be virtual-hosted onto the server, and the entire
thing is remapped onto the application using an alternate URL structure.
so a user might type in :
app.example.com
anotherapp.example.com
which is internally rewritten as :
example.com/apps/app.example.com
example.com/apps/anotherapp.example.com
when doing a 404 'addslash' , i need to 404 onto the original 'browser'
domain -- not the internally rewritten URL
BAD 404
example.com/apps/anotherapp.example.com/something/
GOOD 404
anotherapp.example.com/something/
I figured something workable out , after writing my own
`CustomAppendSlashNotFoundViewFactory` that did... absolutely nothing
different. it was just easier to test on.
the issue was largely from having the Akhet plugin installed
Akhet sets up the static views with this pattern:
pattern = "/*subpath"
It's noted in a few places in Pyramid docs , including...
http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/hybrid.html#using-subpath-in-a-route-pattern
and is used in a few random examples.
having `/*subpath` screws up the NotFoundViewFactory. It ends up being a
wildcard match, with negates this bit of the AppendSlashNotFoundViewFactory
if mapper is not None and not path.endswith('/'):
slashpath = path + '/'
for route in mapper.get_routes():
if route.match(slashpath) is not None:
qs = request.query_string
if qs:
qs = '?' + qs
return HTTPFound(location=request.path+'/'+qs)
No matter what you do, /*subpath will always match, so you will always
appendslash. because the appendslash happens on an already-modified URL ,
the user gets the modified URL with a slash on it.
I gutted Akhet from the app, filed a note that it causes compatibility
issues. There should probably be a note in pyramid as well.
Now that I control the NotFoundFactory, I can unmask the url if I need to
later on ( ie, un-rewrite the URL and then add the slash ). However, I
don't think any of that will be necessary.
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/groups/opt_out.