I'm using the latest yaws checked out from CVS and I'm having trouble with appmods on "/". I seem to recall that I've made this work previously.

Example appmod I'm using as a minimal test:

-module(smallmod).
-include("/usr/local/lib/yaws/include/yaws_api.hrl").
-export([out/1]).

out(A)->  {html, io_lib:format("Hello world! Appmoddata is ~p.",[ A#arg.appmoddata]) }.


First - with "appmods = <"/small",smallmod>", everything works fine:

1. http://test.com/small  returns: Hello world! Appmoddata is undefined.
2. http://test.com/small/  returns: Hello world! Appmoddata is "/".
3. http://test.com/small/foobar  returns: "Hello world! Appmoddata is "foobar".

although I feel an empty string/list would have been a more consistent return value for case #2, alternatively return value "","/","/foobar" for cases #1-3. But that is less important.


The main problems occur when I try a "root" appmod with "appmods = <"/",smallmod>":

1. http://test.com/  passes through handling to yaws and returns the docroots index page.
2. http://test.com//  returns: Hello world! Appmoddata is [].
3. http://test.com/foobar  returns nothing, console reports this error:
       Yaws process died: {function_clause,[{lists,sublist_2,[["foobar"],-1]},
                                     {yaws_server,do_url_type,4},
                                     {yaws_server,url_type,3},
                                     {yaws_server,handle_request,3},
                                     {yaws_server,aloop,3},
                                     {yaws_server,acceptor0,2},
                                     {proc_lib,init_p,5}]}



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 ""?


/Tobias