Yep, tried out the updated cvs-version, root-appmods work now, thanks!

Had a look at yaws_showarg, very useful! (You hadn't added it to the makefile yet though so it doesn't get compiled in by default)

I get these results now, not quite the same as

appmods = <"/small",yaws_showarg>

http//test.com/small         appmoddata: undefined    pathinfo: undefined    1.68 appmoddata: []
http//test.com/small/        appmoddata: "/"    pathinfo: "/"
http//test.com/small/foo    appmoddata: "foo"    pathinfo: "/foo"

appmods = <"/",yaws_showarg>

http//test.com/          appmoddata: []       pathinfo: undefined
http//test.com/foo    appmoddata: "foo"    pathinfo: "/foo"

I'll use pathinfo from now on, and the results are predictable and consistent. The contents of appmoddata has changed slightly from 1.68 though (as I listed in my second mail last night), but that is not a problem for me.



On 3/14/07, julian@precisium.com < julian@precisium.com> wrote:
>The main problems occur when I try a "root" appmod with "appmods = <"/",smallmod>":
Sorry - yes -  I didn't properly take account of root appmods as a special case when adding the vdir stuff.
...
>I also tested "appmods = <"",smallmod>" and there I got the badmatch-error of case #3 above for every possible url, but that seems fine as I understand the correct way of specifying it is "/", not ""?
That's been my understanding.
 
Please try the latest CVS and see if it fits your expectations better.
 
The handling of root appmods will always be something of an edge case I suspect - with the potential to surprise someone no matter what we do.
Consider for starters that http://someserver/   and http://someserver    both end up  as an http GET / 
 
I've taken the view that when specifying an appmod path it's a segment 'between' slashes that is the point corresponding to the appmod.
Thus in the root appmod case - although it's specified in the conf as "/"  it's really more like the appmod applies to the notional empty string before that slash.
This then makes sense in that arg.pathinfo, when defined, will always have a leading slash.
 
Note that arg.pathinfo & arg.prepath are more general concepts that should replace arg.appmoddata & arg.appmod_prepath for future work with the arg record.
e.g they're applicable also to cgi/.yaws pages
They differ slightly in their handling of slashes compared to the 'appmod' fields.
appmoddata is *supposed* to retain the behaviour of the previous Yaws release - I'll need to review that.
 
Try the new yaws_showarg  appmod as a reasonably convenient way of comparing all these values.
e.g as a root appmod
appmod = </ , yaws_showarg>
or as a 'floating' appmod
appmod = <showarg, yaws_showarg>
 
I think there's room for discussion re undefined vs [] in some of the arg fields.
 
Cheers,
 
Julian Noble