Commits on Jul 1, 2018
  1. Fix #340: fix exception handling in deliver_dyn_part/8

    vinoski committed Jul 1, 2018
    Use the MAKE_ST macro within the try/catch in deliver_dyn_part/8 so
    that the stacktrace is portably and correctly retrieved.
Commits on Jun 26, 2018
  1. Removed the windows build from the release script

    Klacke Wikstrom
    Klacke Wikstrom committed Jun 26, 2018
  2. Bumped version to 2.0.6

    Klacke Wikstrom
    Klacke Wikstrom committed Jun 26, 2018
Commits on Jun 24, 2018
  1. Changes for Erlang/OTP 21.0

    vinoski committed Jun 24, 2018
    Because of changes in erlang:get_stacktrace/0 in 21.0, add a macro for
    portably obtaining stack traces across versions, and modify code using
    stack traces to use the macro.
    Add portability support for ssl:handshake/2 and error_logger to
    In yaws_server:acceptor0/2 we should use yaws_dynopts:ssl_handshake/2
    for portability across versions, but it doesn't work for pre-OTP 21.0
    releases yet, so for now keep the ssl:ssl_accept/2 call but mask it so
    the compiler doesn't issue deprecation errors.
    In yaws_log:init/1, for portability across versions, add a call to
    yaws_dynopts:start_error_logger/0 to ensure error_logger is started
    before first use.
Commits on May 31, 2018
  1. Fix missing space in yaws_server:handle_out_reply/5

    leoliu committed May 31, 2018
Commits on Apr 23, 2018
  1. Fix #332: recognize '?' in conf strings

    vinoski committed Apr 23, 2018
    The documentation for serveralias states that it allows wildcards,
    specifically that "'?' matches one character unless that character is
    a period ('.')", but issue #332 shows that using a '?' as specified
    results in a bad conf error.
    Modify yaws_config to allow '?' characters in configuration
    strings. Modify the yaws_sni_strict test configuration to use '?' in a
    serveralias configuration setting as a regression test.
Commits on Apr 11, 2018
  1. Preparing for 2.0.5

    klacke committed Apr 11, 2018
Commits on Mar 24, 2018
  1. Fix #327: Update HTML leaf elements

    vinoski committed Mar 24, 2018
    Update HTML leaf elements in yaws_html.erl based on the list provided
    at .
    Change the mail application to call yaws_html:tag_type/1 instead of
    having its own copy of that function.
Commits on Mar 23, 2018
  1. Update out/1 return values documentation

    vinoski committed Mar 23, 2018
    Update yaws.tex and yaws_api.5 to describe all out/1 return values and
    to make the descriptions in each document match.
Commits on Mar 22, 2018
  1. Add the ysession_cookiegen configuration variable to allow users to

    vinoski committed Mar 22, 2018
    specify a module that can generate session cookies for
    yaws_session_server. Add handling of this variable to
    yaws_config. Document the ysession_cookiegen configuration variable in
    yaws.tex, yaws.conf.5, and yaws_api.5.
    Add the ysession_cookiegen field to the gconf record. Use it in
    yaws_session_server when it needs to generate a session cookie. If the
    field specifies a module, call the module's new_cookie/0 function to
    get a new session cookie. Add setter and getter functions for this
    field to yaws.erl, and also modify setup_gconf to setup this field and
    other missing ysession fields.
    Add a new test to yaws_sessions_server_SUITE to verify that
    yaws_session_server properly calls the custom session cookie generator
    module when configured.
Commits on Mar 20, 2018
  1. Fix #325: put extra HTML inside html block

    vinoski committed Mar 20, 2018
    In yaws_server:deliver_xxx/4, place ExtraHtml inside the generated
    <html> ... </html> block.
Commits on Mar 19, 2018
Commits on Mar 18, 2018
  1. Fix #323: pass returned #arg{} to next out/1 replies

    vinoski committed Mar 18, 2018
    When a composite out/1 reply includes a new #arg{}, pass it, rather
    than the original #arg{}, to any subsequent constructs in the same
    composite out/1 reply.
    Add a new test, appmod_with_yssi, in which an appmod returns a
    composite out/1 reply where the first element is a new #arg{} with the
    state field set to the atom yssi, and the second element is a yssi
    page. The yssi page returns a header named "x-yssi" with the value set
    to the equivalent of "state=A#arg.state". The test verifies that the
    "x-yssi" header holds the expected value "state=yssi", which occurs
    only if the #arg{} returned from the first step is correctly passed to
    the second step.
Commits on Mar 14, 2018
  1. Minor doc fixes

    vinoski committed Mar 14, 2018
Commits on Jan 30, 2018
Commits on Jan 24, 2018
  1. Improvements for testing on Travis CI

    Christopher Faulet authored and vinoski committed Dec 1, 2017
    To help diagnose problems on the Travis CI platform, print log file
    content and yaws.log content when the testsuite fails. Fix the
    testsuite to print skipped tests, which were not correctly reported.
    Add Erlang/OTP 20.1 and 20.2 support in .travis.yml.
Commits on Oct 2, 2017
  1. Fix Allow header setting in accumulate_header

    vinoski committed Oct 2, 2017
    Fix #313 by setting the Allow header, not the Date header, in the
    accumulate_header clause for Allow.
Commits on Jul 18, 2017
  1. Make the cookies parser more permissive

    Christopher Faulet
    Christopher Faulet committed Jul 18, 2017
    Now, trailing spaces are ignored. So the following cookie is now valid:
      "session=app@local-123; "
  2. Fix errors formatting in yaws_compile

    Christopher Faulet
    Christopher Faulet committed Jul 12, 2017
    Errors returned by compile module have the following format:
      {ErrorLine, Module, ErrorDescriptor}
    ErrorLine can be the atom 'none' when the line cannot be determined. This case
    was not handled by yaws_compile module, leading to a badarith exception.
    Same was true for warnings.
Commits on Jul 13, 2017
  1. Ensure compilation with debug_info in rebar-pre-script

    kejv authored and vinoski committed Jul 13, 2017
    As a follow-up to 5d755a6, add +debug_info to erlc commands in
    scripts/rebar-pre-script so that Yaws can be used with dialyzer.
    Also tweak the script so that the names of the source files being
    manipulated in that section appear only once.
Commits on Jun 28, 2017
  1. Be sure to support SNI to explicitly disable it in the testsuite

    capflam committed Jun 28, 2017
    In fact, SNI support on the client side was introducted in R16B03-1. But we can
    safely rely on its support on the server side (introduced in Erlang/OTP 18)
    because this only matters on Erlang/OTP 20.0 and greater.
Commits on Jun 27, 2017
  1. Changes for Erlang/OTP 20.0

    vinoski committed Jun 27, 2017
    In testsuite.erl, explicitly disable SNI if not set because in
    Erlang/OTP 20.0, it is set by default to the Host value used in
    ssl:connect/4 (Christopher).
    Fix old-style catch in yaws_server.erl that caused a compilation
    warning under Erlang/OTP 20.0 (Steve).
    Remove an old zlib workaround in yaws_zlib.erl, as it's no longer
    needed (Christopher).
    Add versions 19.3 and 20.0 to the .travis file.
Commits on Jun 8, 2017
Commits on Apr 27, 2017
  1. Fix #306: ignore http_error tuples in yaws_api:fold_others/4

    vinoski committed Apr 27, 2017
    When processing HTTP headers in yaws_api:fold_others/4, ignore
    http_error tuples and other values that are not http_header tuples.
Commits on Apr 21, 2017
  1. Remove 'export_all' compile option and export public functions explic…

    capflam committed Apr 21, 2017
    Unlike the testsuite, modules updated by this patch have been updated to export
    explicitly public functions instead of using 'expor_all' compile option. This
    remove compilation errors in Erlang/OTP 20.
  2. Compile testsuite modules with '+nowarn_export_all' option

    capflam committed Apr 21, 2017
    This remove compilation errors with Erlang/OTP 20. Instead of exporting
    explicitly public functions, it is easier to ignore the warning.
Commits on Apr 18, 2017
Commits on Apr 11, 2017
Commits on Apr 10, 2017
  1. Fix writing of yaws_dynopts.erl if path contains tilde

    weisslj authored and capflam committed Apr 10, 2017
    Writing of yaws_dynopts.erl fails if the Yaws include path contains a
    tilde (~) character. This happens often on Windows for long paths (e.g.
        git clone yaws~1
        autoreconf -fi && ./configure && make && make test
        Kernel pid terminated (application_controller) ({application_start_failure,yaws,{{shutdown,{failed_to_start_child,yaws_server,{badarg,[{io,format,[<0.168.0>,"-module(yaws_dynopts).\n\n-include(\"/home ...
Commits on Jan 31, 2017
  1. Improve finding of private ports

    weisslj authored and capflam committed Dec 12, 2016
    Since df1d7bf Yaws does not really open port 0 anymore, but tries to
    open one from 49152 onwards. This leads to "badbind" errors when e.g.
    executing multiple separate common test runs which use Yaws repeatedly.
    With this patch port 0 is opened instead, the port number retrieved, and
    closed again. This still is not completely safe, as the port could be
    taken by another application in the short time Yaws tries to listen on
    it again, but in practice I could not reproduce badbind errors.
    This approach leaves all advantages of df1d7bf, but also respects the
    local range for dynamic ports if specified, see
    Here is a test program which illustrates the problem. With this patch
    it runs continuously, without it stops with "badbind":
        trap "exit" INT TERM
        trap "kill 0" EXIT
        sim_testcase () {
            echo "ct run $1, testcase $2"
            output=`erl -pa ebin -noshell \
                -eval 'yaws:start_embedded("www/testdir", [{port, 0}], [], "'$1'")' \
                -eval 'timer:sleep(1000)' \
                -eval 'yaws:stop()' \
                -eval 'init:stop()' \
            if [[ $retval -ne 0 ]] ; then
                case $output in
                    *badbind*) echo "---> BADBIND <---" ;;
                    *) echo "$output" ;;
            return $retval
        sim_ct_run () {
            if sim_testcase $1 $n ; then
                sim_ct_run $1 $n
                kill 0
        set -m
            for tag in `seq 1 $NUM_CT_CONCURRENT` ; do
                sim_ct_run $tag 0 &
  2. Get the port number from the Host header in yaws_api:request_url/1

    capflam committed Jan 31, 2017
    yaws_api:request_url/1 returns the parsed url (a #url{} record) that the
    client requested. field is get from the Host header, with a fallback
    on #sconf.servername. But #url.port was always retrived from the #sconf record
    without any checks on the Host header.
    With this patch, we try to extract the port number from the Host header and we
    fallback on the #sonf record only if there is no Host header. This way,
    yaws_api:request_url/1 is now returning the expected result.
    Fix #297. Thanks to Thomas Rackwitz for reporting the issue and working on it.
Commits on Dec 22, 2016
  1. Add supervisor for websocket callback processes

    vinoski committed Dec 22, 2016
    Add the yaws_ws_sup simple_one_for_one supervisor to start and manage
    websocket callback handler processes.
Commits on Nov 24, 2016
  1. SSL restart bug fixed

    Klacke Wikstrom
    Klacke Wikstrom committed Nov 24, 2016
    Testing tools that stress SSL by sending junk, crashes SSL and yaws
    handles it nicely and restarts - all good. However we're counting
    number of connections erroneously when this happens, and eventually
    we run out of connections.
    If e.g max_connections is 1024, and SSL dies 1024 times, we get into
    "max connections reached" case.
    Found and fixed by Per Hedeland and Tail-f test team