Commits on Jul 12, 2012
  1. @vinoski
Commits on Jul 11, 2012
  1. @capflam

    Add index_files directive into the server part configuration

    This directive sets the list of resources to look for, when a directory is
    requested by the client. If the last entry begins with a "/", and none of
    the earlier resources are found, Yaws will perform a redirect to this uri.
    
    Default is:
      index_files = index.yaws index.html index.php
    capflam committed Jul 11, 2012
Commits on Jul 10, 2012
  1. @vinoski

    wrap SSL sockets in tuple

    Yaws previously internally used details of an SSL socket representation
    that's supposed to be private/opaque to Erlang's SSL support. Encapsulate
    SSL sockets within a {ssl, SslSocket} tuple and add the
    yaws_api:get_sslsocket/1 function that returns a socket for SSL sockets or
    undefined for non-SSL sockets. Also document the new get_sslsocket/1
    function and other minor tweaks to SSL areas of the documentation.
    vinoski committed Apr 20, 2012
  2. @vinoski

    minor changes to server-sent events

    Change yaws_sse to send close connection header by default, and change the
    example to return an Allow header if anything other than GET is requested.
    vinoski committed Jun 29, 2012
  3. @capflam
  4. @capflam

    Refactor Set-Cookie/Cookie header parsing to follow RFC6265

    RFC6265 obsoletes RFC2965 and RFC2109. #setcookie{} and #cookie{} are
    changed to reflect this new RFC. So, yaws_api:parse_set_cookie/1 and
    yaws_api:parse_cookie/1 are refactored accordingly:
    
    * yaws_api:parse_set_cookie/1: Because RFC2109 and RFC2965 are still used,
      we try to be backward compatible with these old RFCs. So this function
      returns a #setcookie{} record when only one cookie is found else it returns
      a list of #setcookie{} records.
      in RFC2109 and RFC2965, cookies are separated by comma. So, comma is
      forbidden in 'path-av' and 'extension-av' except for double-quoted value.
      The parsing are not really strict because of the compatibility and can lead
      to unwanted behaviors.
      Old attributes (like 'Comment' or 'Port') are still parsed and can be
      found into #setcookie.extensions field.
    
    * yaws_api:parse_cookie/1: This function follows the RFC6265, so all cookie
      attributes (like '$Domain' or '$Path') are parsed like any other cookie.
    capflam committed Jul 9, 2012
Commits on Jul 6, 2012
  1. @vinoski

    minor changes to server-sent events

    Change yaws_sse to send close connection header by default, and change the
    example to return an Allow header if anything other than GET is requested.
    vinoski committed Jul 6, 2012
  2. @vinoski

    Merge pull request #113 from tuncer/reltool-update

    Sync with upstream rebar node template
    vinoski committed Jul 6, 2012
  3. @tuncer
Commits on Jul 4, 2012
  1. @capflam

    Fix parse_set_cookie/1 and format_set_cookie/1 functions

    1. According to the RFCs 2109 and 2965, multiple cookies can be set in a
    single 'Set-Cookie' header. So, yaws_api:parse_set_cookie/1 now returns a
    list of #setcookie{} records. If no cookie was found or if an error occurred,
    it returns []. The parsing is also improved.
    Note that this fix breaks the compatibility with previous versions.
    
    2. In yaws_api:format_set_cookie/1, options are now always formated as
    quoted-strings.
    
    3. 2 new functions are added, yaws_api:parse_cookie/1 and
    yaws_api:format_cookie/1, to parse and format 'Cookie' headers. To let these
    functions to work, the #cookie{} record was introduced.
    
    Documentation and testsuite are updated accordingly.
    capflam committed Jul 4, 2012
Commits on Jun 29, 2012
  1. @vinoski
  2. @vinoski
Commits on Jun 27, 2012
  1. @vinoski

    add doc for new functions for manipulating #headers{} records

    Commit cccc578 added new functions to yaws_api for manipulating #headers
    records: set_header/2, set_header/3, get_header/2, and
    delete_header/2. This commit adds the documentation.
    vinoski committed Jun 27, 2012
  2. @vinoski
  3. @capflam @vinoski

    Fix is_revproxy/3 and is_redirect_map/2 in yaws.erl

    In these functions, we try to find the longest matching prefix and not
    the first anymore. So we can have several revproxy/redirect_map definitions
    for which order does not matter.
    
    For example, if we define these revproxy rules (in any order):
      revproxy = /goo    http://www.worldofgoo.com     (1)
      revproxy = /       http://yaws.hyber.org         (2)
      revproxy = /erl    http://www.erlang.org         (3)
      revproxy = /google http://www.google.com         (4)
    
    then
      http://localhost will match the rule (2)
      http://localhost/goo will match the rule (1)
      http://localhost/google/search will match the rule (4)
      http://localhost/erl will match the rule (3)
    
    We also change how the matching is made. Now, the matching is done by
    splitting the path on slashes. So, using previous rules, "/google" is the
    longest prefix for the path "/google/test" and "/" is the longest prefix
    for "/erlang".
    capflam committed with vinoski Jun 27, 2012
  4. @capflam @vinoski
  5. @capflam @vinoski

    Handle undefined docroot when the fullpath of a request is built

    Now, the internal function yaws_server:construct_fullpath/3 returns
    'undefined' when there is no docroot. This might only happen for servers
    with an appmod on "/" (because docroot is optional in that case).
    
    Note that such appmods cannot return ssi or yssi structures.
    capflam committed with vinoski Jun 27, 2012
  6. @vinoski

    loosen docroot checking for certain server configs

    For server configurations that define a reverse proxy, redirection for the
    path "/", forward proxies, or appmods on "/", a docroot isn't
    needed. Change yaws_config to avoid errors for missing docroot settings for
    such servers. Add test/t6 to check these configurations.
    vinoski committed Jun 25, 2012
Commits on Jun 26, 2012
  1. @vinoski

    use localtime not universaltime for server_sent_events example

    Looks like httpd_util:rfc1123_date/1 wants local time, not UTC time, as its
    time argument. The server_sent_events example uses that function to create
    the server date string events.
    vinoski committed Jun 26, 2012
  2. @vinoski

    Merge pull request #111 from tuncer/typo

    Fix trivial typo in server_sent_events.yaws
    vinoski committed Jun 26, 2012
  3. @tuncer
Commits on Jun 25, 2012
  1. prepare for 1.94

    committed Jun 25, 2012
  2. @vinoski

    add news items for upcoming 1.94

    vinoski committed Jun 25, 2012
  3. @vinoski

    add support for W3C Server-Sent Events

    Server-Sent Events is a W3C working draft allowing servers to send simple
    events to a client. See the documentation in www/server_sent_events.yaws
    for a full description.
    vinoski committed Jun 1, 2012
Commits on Jun 24, 2012
  1. prepare for 1.94

    committed Jun 24, 2012
  2. The random patch for 1.93 wasn't good enough as discovered by Sergei …

    …Golovan, we need to cater for non printable chars
    committed Jun 24, 2012
Commits on Jun 21, 2012
  1. @vinoski
  2. @vinoski

    add reverse proxy intercept module capability

    Users can now specify an interception module that can rewrite requests and
    responses as they pass through the Yaws reverse proxy. See the
    documentation for details (yaws.conf.5 man page or the yaws.pdf file).
    
    Also add new set_header, get_header, and delete_header functions to the
    yaws_api module to allow intercept modules and arg rewriters to more easily
    examine and modify #headers{} records.
    
    Add new tests for the new header manipulation functions and for the reverse
    proxy interception feature.
    vinoski committed Jun 17, 2012
Commits on Jun 20, 2012
  1. preparing for 1.93

    committed Jun 20, 2012
  2. preparing for 1.93

    committed Jun 20, 2012
  3. preparing for 1.93

    committed Jun 20, 2012
  4. preparing for 1.93

    committed Jun 20, 2012