Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 20 lines (18 sloc) 0.656 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
-module(reentranttest).
-export([out/1]).

-include("../../include/yaws.hrl").
-include("../../include/yaws_api.hrl").

out(Arg) ->
    Url = yaws_api:request_url(Arg),
    case Url#url.path of
        "/reentranttest/status" ->
            {page, {[{status, 201}], "/hello.txt"}};
        "/reentranttest/delayed_headers" ->
            Hdrs = [{header, {cache_control, "no-cache"}},
                    {header, "Etag: static-tag"},
                    {header, "X-Delayed-Header: true"}],
            {page, {Hdrs, "/hello.txt"}};
        _ ->
            Reason = "unknown path: " ++ Url#url.path,
            [{status, 500}, {html, Reason}]
    end.
Something went wrong with that request. Please try again.