Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Commits on Jul 10, 2012
  1. Christopher Faulet

    Refactor Set-Cookie/Cookie header parsing to follow RFC6265

    capflam authored
    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 4, 2012
  1. Christopher Faulet

    Fix parse_set_cookie/1 and format_set_cookie/1 functions

    capflam authored
    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 Apr 11, 2012
  1. Steve Vinoski
Commits on Dec 18, 2011
  1. JD Bothma Steve Vinoski

    update WebSockets implementation to support RFC 6455

    jbothma authored vinoski committed
    This change allows websocket connections to be set up between browsers
    and the yaws server. RFC 6455 for WebSocket connections is supported,
    in addition to the hybi working group RFC drafts 10 to 17.
    
    The quickest way to try this out is by compiling yaws as usual, then
    visiting /websockets_example.yaws at the default local installation
    host. This can be done using Google Chrome 14+, Firefox 7+ or any
    other browser supporting WebSocket version 8 or above. Information
    about getting started with WebSockets using this implementation is
    given in /websockets.yaws.
    
    This drops support for the older draft RFCs, specifically those of the
    hixie working group which were previously supported by yaws but are
    significantly different from the hybi working group's specification.
    
    The interface for using WebSocket with yaws has changed
    somewhat. Instead of spawning a websocket owner process which
    maintains a server loop such as that shown in the old
    websockets_endpoint.yaws, the application developer now implements a
    callback module such as those in src/basic_echo_callback.erl or
    src/advanced_echo_callback.erl -- the difference being that the
    advanced callback style is only necessary if you need advanced
    features of WebSocket such as fragmented messages. One suggested way
    to deploy your callback module and its dependencies is as part of an
    application in an OTP release, with yaws as a dependency. Rebar can be
    used to build the dependencies, fetch and build yaws, and create a
    release which will ensure the modules are in the path of the runtime
    system.
    
    Most behaviour tested by the Autobahn test suite 0.43 pass when
    configured to connect to the /websockets_autobahn_endpoint.yaws and
    /websockets_example_endpoint.yaws over an unencrypted
    connection. Significantly, websocket connection closing is not
    implemented and the socket is left to be cleaned up by the Runtime
    System when either the connection is lost or the owning processes
    dies. Secondly, certain cases where websocket frames are fragmented
    within UTF-8 code points cause the check for valid text type messages
    to incorrectly fail the connection.
    
    Subprotocols are not currently supported.
    
    Augment yaws.tex with a new WebSocket Protocol chapter (Steve
    Vinoski).
Commits on May 24, 2011
  1. Christopher Faulet Steve Vinoski

    arg_rewrite mods can now return HTTP responses (capflam)

    capflam authored vinoski committed
    Module used to rewrite arg records can now return any HTTP
    response. This can be used to redirect requests or to return an
    error. To do so, such a module must set the element #arg.state using
    the record #rewrite_response{}. The record #rewrite_response{}
    contains 3 elements:
    
      status: any valid HTTP status code
      headers: a list of {header, H}
      content: an iolist
    
    For example, to do an unconditional redirect to http://www.yakaz.com,
    you can use the module simple_redir_mod.erl:
    
      -module(simple_redir_mod.erl).
      -export([arg_rewrite/1]).
      -include_lib("yaws/include/yaws_api.hrl").
    
      arg_rewrite(Arg) ->
        L = "http://www.yakaz.com",
        H = [{header, {location, L}}],
        RwResp = #rewrite_response{status=301, headers=H}
        Arg#arg{state=RwResp}.
Commits on Apr 20, 2011
  1. Steve Vinoski

    major trailing whitespace cleanup

    vinoski authored
    Remove trailing whitespace in all .erl and .hrl files in the
    repository.
    
    If you're an emacs user, you can easily see trailing whitespace using
    settings like these in your ~/.emacs file:
    
    (setq-default show-trailing-whitespace t)
    (set-face-background 'trailing-whitespace "slate gray")
    
    You can also delete trailing whitespace automatically when you save
    your Erlang sources by setting the emacs before-save-hook in your
    ~/.emacs file like this:
    
    (add-hook 'before-save-hook
              '(lambda () (if (eq major-mode 'erlang-mode)
                              (delete-trailing-whitespace))))
Commits on Oct 21, 2010
  1. Fabian Linzberger Steve Vinoski

    add implementation of X-Forwarded-For header (Fabian Linzberger)

    lefant authored vinoski committed
    * Add x_forwarded_for_log_proxy_whitelist global config parameter and
      parsing for it.
    
    * Add x_forwarded_for header in record definition and collection
      (based on code by Chris Double he mentions on
      http://www.bluishcoder.co.nz/2006/04/handling-x-forwarded-for-in-yaws.html)
    
    * For yaws_server:maybe_access_log/3: if originating IP is present in
      x_forwarded_for_log_proxy_whitelist, log last IP found in
      x-forwarded-for header instead of originating IP
Commits on Jul 10, 2009
  1. cgi support

    authored
Commits on Feb 13, 2009
  1. cleaned up the redirect feature. It was poorly implemented and poorly…

    authored
    … documented. This fix is backwards compatible for users using redirect in confd.conf. However, it is NOT backwards compatible for embedded users that specify the redirect_map explicitly in their #sconf{} records. The required changes for embedded users should be evident from the code. The new required format is documented in the code where #sconf{} is defined
    
    git-svn-id: https://erlyaws.svn.sourceforge.net/svnroot/erlyaws/trunk/yaws@1391 9fbdc01b-0d2c-0410-bfb7-fb27d70d8b52
Commits on Sep 12, 2008
  1. added redirect_self to yaws_api

    authored
    git-svn-id: https://erlyaws.svn.sourceforge.net/svnroot/erlyaws/trunk/yaws@1276 9fbdc01b-0d2c-0410-bfb7-fb27d70d8b52
Commits on Dec 1, 2007
  1. tabs cleanup

    authored
    git-svn-id: https://erlyaws.svn.sourceforge.net/svnroot/erlyaws/trunk/yaws@1181 9fbdc01b-0d2c-0410-bfb7-fb27d70d8b52
Commits on Feb 23, 2007
  1. jonhen
Commits on Sep 20, 2006
Commits on Mar 16, 2004
  1. Removed the atoms in parse_post and parse query, backwards incompatib…

    authored
    …le change updateed wiki and mail for this, added a backwards_compat_flag to gconf put gconf and sconf in the dictionary as opposed to passing them around as args reworked url_type so there are no more flat lists, removed the list_to_atom call for the spec cache.
    
    git-svn-id: https://erlyaws.svn.sourceforge.net/svnroot/erlyaws/trunk/yaws@632 9fbdc01b-0d2c-0410-bfb7-fb27d70d8b52
Commits on Mar 13, 2004
  1. ""

    authored
    git-svn-id: https://erlyaws.svn.sourceforge.net/svnroot/erlyaws/trunk/yaws@630 9fbdc01b-0d2c-0410-bfb7-fb27d70d8b52
Commits on Mar 10, 2004
  1. postvar bug by hal snyder, added yaws_api:query_url/1 added the id su…

    authored
    …pport and removed the uid stuff, added -j to control trace of a running daemon, bugfixes in the logger,
    
    git-svn-id: https://erlyaws.svn.sourceforge.net/svnroot/erlyaws/trunk/yaws@626 9fbdc01b-0d2c-0410-bfb7-fb27d70d8b52
Commits on Feb 8, 2004
  1. carsten3347

    Support for `Content-Encoding: deflate' using zlib.

    carsten3347 authored
    This feature has to be turned on in the server part of yaws.conf
    (`deflate = true').
    
    Still experimental and for static files only.  Cached files are
    compressed just once.  Large files are compressed on the fly, and only
    if the mime type makes it seem wothwhile (see
    yaws_server:compressible_mime_type).  No docs so far.
    
    
    git-svn-id: https://erlyaws.svn.sourceforge.net/svnroot/erlyaws/trunk/yaws@594 9fbdc01b-0d2c-0410-bfb7-fb27d70d8b52
Commits on Dec 17, 2003
  1. postvar(), queryvar(), ssi docs

    authored
    git-svn-id: https://erlyaws.svn.sourceforge.net/svnroot/erlyaws/trunk/yaws@562 9fbdc01b-0d2c-0410-bfb7-fb27d70d8b52
  2. ssi include with var expansion + docs

    authored
    git-svn-id: https://erlyaws.svn.sourceforge.net/svnroot/erlyaws/trunk/yaws@561 9fbdc01b-0d2c-0410-bfb7-fb27d70d8b52
Commits on Dec 15, 2003
  1. first almost working vsn of revproxy

    authored
    git-svn-id: https://erlyaws.svn.sourceforge.net/svnroot/erlyaws/trunk/yaws@558 9fbdc01b-0d2c-0410-bfb7-fb27d70d8b52
Commits on Dec 5, 2003
  1. Added set cookie parser

    Johan Bevemyr authored
    git-svn-id: https://erlyaws.svn.sourceforge.net/svnroot/erlyaws/trunk/yaws@556 9fbdc01b-0d2c-0410-bfb7-fb27d70d8b52
Commits on Aug 25, 2003
  1. carsten3347
Commits on Jul 16, 2003
  1. carsten3347

    Added CGI and PHP support.

    carsten3347 authored
    Also for a request like
         /a/b/c.xxx/d/e
    with xxx being one of `yaws', `cgi' or `php' and c.xxx being a plain
    file, /a/b/c.xxx is called with Arg#arg.pathinfo, respectively the
    environment variable PATH_INFO, set to `/d/e'.
    
    
    git-svn-id: https://erlyaws.svn.sourceforge.net/svnroot/erlyaws/trunk/yaws@459 9fbdc01b-0d2c-0410-bfb7-fb27d70d8b52
Commits on Jul 12, 2003
  1. Added the field server_path, which will store the parsed and normaliz…

    Leon Smith authored
    …ed path of the request string. This is in preparation for some significant clean-ups of the yaws_server.erl code.
    
    git-svn-id: https://erlyaws.svn.sourceforge.net/svnroot/erlyaws/trunk/yaws@448 9fbdc01b-0d2c-0410-bfb7-fb27d70d8b52
Commits on Nov 20, 2002
  1. parse_url

    authored
    git-svn-id: https://erlyaws.svn.sourceforge.net/svnroot/erlyaws/trunk/yaws@290 9fbdc01b-0d2c-0410-bfb7-fb27d70d8b52
Commits on Nov 18, 2002
  1. Added #args.appmod_prepath which contains the path in front

    Tobbe Tornquist authored
    of <appmod><appmoddata>
    
    
    git-svn-id: https://erlyaws.svn.sourceforge.net/svnroot/erlyaws/trunk/yaws@282 9fbdc01b-0d2c-0410-bfb7-fb27d70d8b52
Commits on Nov 7, 2002
  1. ""

    authored
    git-svn-id: https://erlyaws.svn.sourceforge.net/svnroot/erlyaws/trunk/yaws@252 9fbdc01b-0d2c-0410-bfb7-fb27d70d8b52
Commits on Oct 16, 2002
Commits on Oct 15, 2002
  1. fixed tilde username expansion it didn't work, also made thta a confi…

    authored
    …gurable in the config file. Added appmods a mechanism whereby an application can fake directory hierachys. Useful for applications that deliver
    
    content which isn't html. Many browsers doesn;t (read IE) don't respect the
    Content-Disposition: header, rather they just use the filename extension to
    determini which plugin to to render a file
    
    
    git-svn-id: https://erlyaws.svn.sourceforge.net/svnroot/erlyaws/trunk/yaws@206 9fbdc01b-0d2c-0410-bfb7-fb27d70d8b52
Commits on Oct 6, 2002
  1. wrote the shopppingcart example

    authored
    git-svn-id: https://erlyaws.svn.sourceforge.net/svnroot/erlyaws/trunk/yaws@191 9fbdc01b-0d2c-0410-bfb7-fb27d70d8b52
Commits on Sep 17, 2002
  1. cache_refresh to 0 if debug, added a cookie_session-server for persis…

    authored
    …tant cookie sessions
    
    git-svn-id: https://erlyaws.svn.sourceforge.net/svnroot/erlyaws/trunk/yaws@173 9fbdc01b-0d2c-0410-bfb7-fb27d70d8b52
Commits on Sep 13, 2002
Commits on Aug 23, 2002
  1. added cont and state to this yaws_api.hrl

    Seah Hinde authored
    git-svn-id: https://erlyaws.svn.sourceforge.net/svnroot/erlyaws/trunk/yaws@138 9fbdc01b-0d2c-0410-bfb7-fb27d70d8b52
Commits on Jun 27, 2002
  1. Added fullpath to arg

    Johan Bevemyr authored
    git-svn-id: https://erlyaws.svn.sourceforge.net/svnroot/erlyaws/trunk/yaws@116 9fbdc01b-0d2c-0410-bfb7-fb27d70d8b52
Commits on Apr 30, 2002
  1. ""

    authored
    git-svn-id: https://erlyaws.svn.sourceforge.net/svnroot/erlyaws/trunk/yaws@54 9fbdc01b-0d2c-0410-bfb7-fb27d70d8b52
Something went wrong with that request. Please try again.