Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

29 lines (24 sloc) 0.828 kB
<erl>
out(A) ->
{Code, F} = case queryvar(A, "file") of
{ok, Fname} ->
File = A#arg.docroot ++
yaws_api:sanitize_file_name(Fname),
case file:read_file(File) of
{ok, B} ->
C = {'div',
[],
{pre, [], B}},
{C, Fname};
_ ->
{[], "Can't read " ++ Fname }
end;
undefined ->
{[], "Bad request"}
end,
{ehtml, {html, [],
{'div',
[],
[{h2, [], F},
Code]}}}.
</erl>
Jump to Line
Something went wrong with that request. Please try again.