Every repository with this icon (
Every repository with this icon (
| Description: | Yaws webserver edit |
-
it is not a good idea to ship the ssl key file in the tarball, because
everyone can download it. I recommend shipping a script that can generate
the *.pem files during or after installation.
Comments
-
in apache i can set option
DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htmand when i write url http://whoz.ru, automate go to http://whoz.ru/index.php
can you make this option in you web server
Comments
lordmetroid
Wed Oct 28 10:40:01 -0700 2009
| link
Not the most convenient method but I suppose one could write an yaws_rewrite_mod as a workaround...
-
Hello,
I'm trying to generate a soap fault from a yaws soap endpoint, what's the correct return from handle function ?
I'm trying with:
{error,undefined, #'soap:Fault'{ anyAttribs = [], faultcode = "error", faultstring = Error } }But yaws_soap_srv prints :
yaws_soap_srv(239): Srv Error: "Error processing message: {error,undefined,\n {'soap:Fault',[],"error","econnrefused",\n undefined,undefined}}"Any idea ?
Thanks. Regards.
Comments
The following is from Willem de Jong, the primary contributor of the Yaws SOAP support.
Unfortunately this is not as easy as it should be. One of the problems is the fact that the
faultcodeelement has to be a qualified name. It might for example look like this:<soap:Fault> <faultcode>soap:Server</faultcode> ...Note that the
soap:in the value has to match the prefix of a declared namespace, and the declaration of namespaces is something that is kind of hard to control (it is something that you would typically like your libraries to take care of).You could try to do this (using some undocumented erlsom support for qualified names):
Fault = #'soap:Fault'{ faultcode = {qname, "http://schemas.xmlsoap.org/soap/envelope/", "soap", "Server", undefined}, faultstring = Error}, {ok, undefined, Fault, 500, undefined}Note that I used
okinstead oferror, and that I used a tuple with 5 elements in order to be able to specify the result code (500).Alternatively, you can have a look at the
result()function inyaws_soap_srv.erland themakeFault()function inyaws_soap_lib.erl, and adapt these to your needs. That should be relatively straightforward.
-
The text/_ content is generally minuscule contribution to the loading times.
files like image/png, application/javascript amongst other file types are also in need to be compressed.Having the compressible_mime_type definitions in the hardcoded like it is in yaws_server.erl is really limiting. I suggest loading configuration from config.
Comments
-
Hello,
Trying to change database backend for a old yaws project to couchdb , I've found that json in couch it's not compatible with json:encode, at least in binaries related stuff. I've patched json.erl to support only encoding of binaries in keys and value,
The patch it's the following, applied to 1.85 version, feel free to apply it if it's useful for another people.
Index: src/json.erl =================================================================== --- src/json.erl (revisión: 9410) +++ src/json.erl (copia de trabajo) @@ -109,6 +109,8 @@ unicode -> encode_string(xmerl_ucs:to_utf8(L)); no -> exit({json_encode, {not_string, L}}) end; +encode(B) when is_binary(B) -> + encode(erlang:binary_to_list(B)); encode({array, Props}) when is_list(Props) -> encode_array(Props); encode({struct, Props} = T) when is_list(Props) -> encode_object(T); encode(Bad) -> exit({json_encode, {bad_term, Bad}}). @@ -116,6 +118,8 @@ %% Encode an Erlang string to JSON. %% Accumulate strings in reverse. +encode_string(B) when is_binary(B) -> + encode_string(erlang:binary_to_list(B)); encode_string(S) -> encode_string(S, [$"]). % " fix highlight for vim :) encode_string([], Acc) -> lists:reverse([$" | Acc]); % " fix highlight for vim :) @@ -145,6 +149,7 @@ encode_object({struct, _Props} = Obj) -> M = obj_fold(fun({Key, Value}, Acc) -> S = case Key of + B when is_binary(B) -> encode_string(B); L when is_list(L) -> encode_string(L); A when is_atom(A) -> encode_string(atom_to_list(A)); _ -> exit({json_encode, {bad_key, Key}})Comments
Hello,
The version that you refer not supports binaries as keys as mine.Regards.












I did some work on this - but not all the way