ErlScriptAlias in INETS

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

ErlScriptAlias in INETS

Ulf Wiger-4

I don't know if it's just me, but when I specify an
ErlScriptAlias, I'd like it to look like this:

  ErlScriptAlias / ccviewer

allowing an URL like this:
 http://...ericsson.se:8800/ccviewer/fetch?...

which would end up calling ccviewer:fetch/2.

I found that this doesn't work without slightly tweaking
mod_esi.erl. The diff below did the trick.

The whole modified function looks like this:

load([$E,$r,$l,$S,$c,$r,$i,$p,$t,$A,$l,$i,$a,$s,$
|ErlScriptAlias],[]) ->
    case regexp:split(ErlScriptAlias," ") of
        {ok, ["/"|Modules]} ->
            {ok, [], {erl_script_alias, {[], Modules}}};
        {ok, [ErlName|Modules]} ->
            {ok, [], {erl_script_alias, {ErlName,Modules}}};
        {ok, _} ->
            {error,?NICE(httpd_conf:clean(ErlScriptAlias)++
                         " is an invalid ErlScriptAlias")}
    end;



> diff mod_esi.erl
/OTP/LXA_11930_R7B01_9/lib/inets-2.5.6/src/mod_esi.erl
260,261d259
<       {ok, ["/"|Modules]} ->
<           {ok, [], {erl_script_alias, {[], Modules}}};


Does anyone disagree with this change?

/Uffe
--
Ulf Wiger                                    tfn: +46  8 719 81 95
Senior System Architect                      mob: +46 70 519 81 95
Strategic Product & System Management    ATM Multiservice Networks
Data Backbone & Optical Services Division      Ericsson Telecom AB