Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix tabs and insert some vim headers

  • Loading branch information...
commit ea7d7e9e7366a4497df5a9cde76124fabbd98eea 1 parent 13ed2af
@choptastic choptastic authored
View
1  src/mochiweb_bridge_modules/mochiweb_request_bridge.erl
@@ -1,3 +1,4 @@
+% vim: sw=4 ts=4 et
% Simple Bridge
% Copyright (c) 2008-2010 Rusty Klophaus
% See MIT-LICENSE for licensing information.
View
1  src/mochiweb_bridge_modules/mochiweb_response_bridge.erl
@@ -1,3 +1,4 @@
+% vim: sw=4 ts=4 et
% Simple Bridge
% Copyright (c) 2008-2010 Rusty Klophaus
% See MIT-LICENSE for licensing information.
View
65 src/yaws_bridge_modules/yaws_response_bridge.erl
@@ -1,3 +1,4 @@
+% vim: sw=4 ts=4 et
% Simple Bridge
% Copyright (c) 2008-2010 Rusty Klophaus
% See MIT-LICENSE for licensing information.
@@ -8,7 +9,7 @@
-export ([build_response/2,init/1]).
init(_Arg) ->
- _Arg.
+ _Arg.
build_response(_Arg, Res) ->
% Get vars...
@@ -21,8 +22,8 @@ build_response(_Arg, Res) ->
case Res#response.data of
{data, Body} ->
- %% Get the content type...
- ContentType = get_content_type(Res),
+ %% Get the content type...
+ ContentType = get_content_type(Res),
% Send the yaws response...
lists:flatten([
@@ -32,38 +33,38 @@ build_response(_Arg, Res) ->
]);
{file, Path} ->
- %% Note: This section should only be entered in the event that a static file is
- %% requested that isn't found in the 'appmod' section of the yaws.conf file.
- %% I've not found a way to "pass the buck" back to yaws and say "even though this
- %% directory isn't found in the appmod, I want you to serve it anyway". This
- %% means that with the current implementation, you don't want to be serving files
- %% big files that aren't covered in the appmod section, primarily because this little
- %% snippet loads the entire file into memory then passes it off to yaws to be served,
- %% rather than streaming it. I'll need to look further into to either 1) Pass the buck
- %% completely back to Yaws, or 2) how the streamcontent return types work as define in
- %% yaws_server:handle_out_reply
-
- ExpireDate = simple_bridge_util:expires(years, 10),
-
- %% Docroot needed to find file in Path
- Docroot = yaws_api:arg_docroot(_Arg),
- FullPath = [Docroot,Path],
-
- %% Get the content type as defined by yaws
- ContentType = yaws_api:mime_type(Path),
+ %% Note: This section should only be entered in the event that a static file is
+ %% requested that isn't found in the 'appmod' section of the yaws.conf file.
+ %% I've not found a way to "pass the buck" back to yaws and say "even though this
+ %% directory isn't found in the appmod, I want you to serve it anyway". This
+ %% means that with the current implementation, you don't want to be serving files
+ %% big files that aren't covered in the appmod section, primarily because this little
+ %% snippet loads the entire file into memory then passes it off to yaws to be served,
+ %% rather than streaming it. I'll need to look further into to either 1) Pass the buck
+ %% completely back to Yaws, or 2) how the streamcontent return types work as define in
+ %% yaws_server:handle_out_reply
+
+ ExpireDate = simple_bridge_util:expires(years, 10),
+
+ %% Docroot needed to find file in Path
+ Docroot = yaws_api:arg_docroot(_Arg),
+ FullPath = [Docroot,Path],
+
+ %% Get the content type as defined by yaws
+ ContentType = yaws_api:mime_type(Path),
%% Get the file content
FullResponse = case file:read_file(FullPath) of
- {error,enoent} ->
- yaws_outmod:out404(_Arg);
- {ok,Bin} ->
- [
- {status, Code},
- [{header, {"Expires", ExpireDate}} | Headers],
- {content, ContentType, Bin}
- ]
- end,
- lists:flatten(FullResponse)
+ {error,enoent} ->
+ yaws_outmod:out404(_Arg);
+ {ok,Bin} ->
+ [
+ {status, Code},
+ [{header, {"Expires", ExpireDate}} | Headers],
+ {content, ContentType, Bin}
+ ]
+ end,
+ lists:flatten(FullResponse)
end.
assemble_headers(Res) ->
Please sign in to comment.
Something went wrong with that request. Please try again.