~ubuntu-branches/debian/squeeze/erlang/squeeze

« back to all changes in this revision

Viewing changes to lib/inets/src/http_server/mod_esi.erl

  • Committer: Bazaar Package Importer
  • Author(s): Sergei Golovan
  • Date: 2010-03-09 17:34:57 UTC
  • mfrom: (10.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20100309173457-4yd6hlcb2osfhx31
Tags: 1:13.b.4-dfsg-3
Manpages in section 1 are needed even if only arch-dependent packages are
built. So, re-enabled them.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
%%
2
2
%% %CopyrightBegin%
3
 
%% 
4
 
%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
5
 
%% 
 
3
%%
 
4
%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
 
5
%%
6
6
%% The contents of this file are subject to the Erlang Public License,
7
7
%% Version 1.1, (the "License"); you may not use this file except in
8
8
%% compliance with the License. You should have received a copy of the
9
9
%% Erlang Public License along with this software. If not, it can be
10
10
%% retrieved online at http://www.erlang.org/.
11
 
%% 
 
11
%%
12
12
%% Software distributed under the License is distributed on an "AS IS"
13
13
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14
14
%% the License for the specific language governing rights and limitations
15
15
%% under the License.
16
 
%% 
 
16
%%
17
17
%% %CopyrightEnd%
18
18
%%
19
19
%%
249
249
            {proceed, [{status,{400, none, BadRequest}} | ModData#mod.data]}
250
250
    end;
251
251
 
252
 
erl(#mod{method = "POST", entity_body = Body} = ModData, ESIBody, Modules) ->
 
252
erl(#mod{request_uri  = ReqUri, 
 
253
         method       = "PUT",
 
254
         http_version = Version, 
 
255
         data         = Data}, _ESIBody, _Modules) ->
 
256
    {proceed, [{status,{501,{"PUT", ReqUri, Version},
 
257
                        ?NICE("Erl mechanism doesn't support method PUT")}}|
 
258
               Data]};
 
259
 
 
260
erl(#mod{request_uri  = ReqUri, 
 
261
         method       = "DELETE",
 
262
         http_version = Version, 
 
263
         data         = Data}, _ESIBody, _Modules) ->
 
264
    {proceed,[{status,{501,{"DELETE", ReqUri, Version},
 
265
                       ?NICE("Erl mechanism doesn't support method DELETE")}}|
 
266
              Data]};
 
267
 
 
268
erl(#mod{method      = "POST", 
 
269
         entity_body = Body} = ModData, ESIBody, Modules) ->
253
270
    case httpd_util:split(ESIBody,":|%3A|/",2) of
254
271
        {ok,[ModuleName, Function]} ->
255
272
            generate_webpage(ModData, ESIBody, Modules, 
444
461
 
445
462
%%------------------------ Eval mechanism --------------------------------
446
463
 
447
 
eval(#mod{request_uri = ReqUri, method = "POST",
448
 
          http_version = Version, data = Data}, _ESIBody, _Modules) ->
 
464
eval(#mod{request_uri  = ReqUri, 
 
465
          method       = "PUT",
 
466
          http_version = Version, 
 
467
          data         = Data}, _ESIBody, _Modules) ->
 
468
    {proceed,[{status,{501,{"PUT", ReqUri, Version},
 
469
                       ?NICE("Eval mechanism doesn't support method PUT")}}|
 
470
              Data]};
 
471
 
 
472
eval(#mod{request_uri  = ReqUri, 
 
473
          method       = "DELETE",
 
474
          http_version = Version, 
 
475
          data         = Data}, _ESIBody, _Modules) ->
 
476
    {proceed,[{status,{501,{"DELETE", ReqUri, Version},
 
477
                       ?NICE("Eval mechanism doesn't support method DELETE")}}|
 
478
              Data]};
 
479
 
 
480
eval(#mod{request_uri  = ReqUri, 
 
481
          method       = "POST",
 
482
          http_version = Version, 
 
483
          data         = Data}, _ESIBody, _Modules) ->
449
484
    {proceed,[{status,{501,{"POST", ReqUri, Version},
450
485
                       ?NICE("Eval mechanism doesn't support method POST")}}|
451
486
              Data]};