Permalink
Commits on Aug 6, 2012
Commits on Jul 26, 2012
  1. Improve how Yaws is started in embedded mode

    capflam committed Jul 26, 2012
    The main change concerns the function yaws:create_sconf/2. Now, this function
    relies on yaws_config:make_default_sconf/2 to create a default #sconf record.
Commits on Jul 25, 2012
  1. Make the mime types mappings configurable

    capflam committed Jul 19, 2012
    Now, it possible to customize the global mime types mappings and to overload
    it for each virtual server. It can be done using following directives in the
    global part or the server part of the configuration:
    
    * default_type: Defines the default mime type to be used where Yaws cannot
      determine it by its mime types mappings (default: text/plain).
      In the server part, this directive overloads the global one.
    
    * default_charset: Defines the default charset to be added when a response
      content-type is text/* (default: none). In the server part, this directive
      overloads the global one.
    
    * mime_types_file: Overrides the default mime.types file included with Yaws
      (default: ${PREFIX}/lib/yaws/priv/mime.types). In the server part, this
      directive overloads the global one but mappings defined in this file will
      not overload those defined by add_types directives in the global part.
    
    * add_types: Specifies one or more mappings between mime types and file
      extensions. More than one extension can be assigned to a mime type. If a
      mapping is defined in the global part and redefined in a server part using
      this directive, then the later is used. Else the global one is kept.
    
    * add_charsets: Specifies one or more mappings between charsets and file
      extensions. More than one extension can be assigned to a charset. If a
      mapping is defined in the global part and redefined in a server part using
      this directive, then the later is used. Else the global one is kept.
    
    Here is an example:
    
      default_type = text/html
    
      <server localhost>
          port = 8000
          listen = 0.0.0.0
          docroot = /var/www
          # nothing is overloaded in the vhost
      </server>
    
      <server localhost>
          port = 8001
          listen = 0.0.0.0
          docroot = /var/www
    
          # overload global configuration:
          default_type    = text/plain
          mime_types_file = /etc/mime.types
          add_types       = <text/xhtml, yaws> <application/x-test, tst test>
          default_charset = UTF-8
          add_charsets    = <ISO-8859-1, php html yaws> <US-ASCII, tst>
      </server>
    
    During Yaws compilation, a default module 'mime_types' is created using the
    default mime.types file. Then, when yaws starts up, this module is
    re-generated, re-compiled and loaded dynamically. The new module replaces the
    default one but the .beam file is unchanged. So if one of these steps failed,
    we fall back on the default module.
Commits on Jul 24, 2012
Commits on Jul 14, 2012
  1. Merge pull request #117 from tuncer/noderunner

    vinoski committed Jul 14, 2012
    Sync rel/files/yaws with upstream template
Commits on Jul 13, 2012
  1. Merge pull request #116 from sumup/feature/soap12_imports_namespaces

    klacke committed Jul 13, 2012
    Feature/soap12 imports namespaces
Commits on Jul 12, 2012
Commits on Jul 11, 2012
  1. Add index_files directive into the server part configuration

    capflam committed Jul 11, 2012
    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
Commits on Jul 10, 2012
  1. wrap SSL sockets in tuple

    vinoski committed Apr 20, 2012
    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.
  2. minor changes to server-sent events

    vinoski committed Jun 29, 2012
    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.
  3. Refactor Set-Cookie/Cookie header parsing to follow RFC6265

    capflam committed Jul 9, 2012
    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.
Commits on Jul 9, 2012
Commits on Jul 6, 2012
  1. minor changes to server-sent events

    vinoski committed Jul 6, 2012
    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.
  2. Merge pull request #113 from tuncer/reltool-update

    vinoski committed Jul 6, 2012
    Sync with upstream rebar node template
  3. -fixed action header for soap12 requests to contain action rather tha…

    kdcircle committed Jul 6, 2012
    …n operation;
    
    -added namespace registry to allow for wsdl inline schemas in different namespaces
Commits on Jul 4, 2012
  1. Fix parse_set_cookie/1 and format_set_cookie/1 functions

    capflam committed Jul 4, 2012
    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.
Commits on Jun 29, 2012
Commits on Jun 27, 2012
  1. add doc for new functions for manipulating #headers{} records

    vinoski committed Jun 27, 2012
    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.
  2. Fix is_revproxy/3 and is_redirect_map/2 in yaws.erl

    capflam authored and vinoski committed Jun 27, 2012
    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".
  3. Handle undefined docroot when the fullpath of a request is built

    capflam authored and vinoski committed Jun 27, 2012
    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.
  4. loosen docroot checking for certain server configs

    vinoski committed Jun 25, 2012
    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.
Commits on Jun 26, 2012
  1. use localtime not universaltime for server_sent_events example

    vinoski committed Jun 26, 2012
    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.
  2. Merge pull request #111 from tuncer/typo

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

    klacke committed Jun 25, 2012