From d9671919ed9d0cbdc71f4e83d4cc11d200482226 Mon Sep 17 00:00:00 2001 From: Ingela Anderton Andin Date: Wed, 27 May 2015 09:01:07 +0200 Subject: inets: Add customize option Many HTTP headers are optional, and it could be desirable for the server to filter and maybe even alter them without replacing the mod_* modules that generate/process them. Add new behaviour httpd_custom_api with default implementation in httpd_custom.erl. Add behaviour module in 18 as then we can specify optional callbacks. --- lib/inets/doc/src/Makefile | 3 +- lib/inets/doc/src/httpd.xml | 10 +++++- lib/inets/doc/src/httpd_custom_api.xml | 63 ++++++++++++++++++++++++++++++++++ lib/inets/doc/src/ref_man.xml | 3 +- 4 files changed, 76 insertions(+), 3 deletions(-) create mode 100644 lib/inets/doc/src/httpd_custom_api.xml (limited to 'lib/inets/doc/src') diff --git a/lib/inets/doc/src/Makefile b/lib/inets/doc/src/Makefile index 1a8e1c7ca8..961bfa838d 100644 --- a/lib/inets/doc/src/Makefile +++ b/lib/inets/doc/src/Makefile @@ -1,7 +1,7 @@ # # %CopyrightBegin% # -# Copyright Ericsson AB 1997-2012. All Rights Reserved. +# Copyright Ericsson AB 1997-2015. All Rights Reserved. # # The contents of this file are subject to the Erlang Public License, # Version 1.1, (the "License"); you may not use this file except in @@ -52,6 +52,7 @@ XML_REF3_FILES = \ httpc.xml\ httpd.xml \ httpd_conf.xml \ + httpd_custom_api.xml \ httpd_socket.xml \ httpd_util.xml \ mod_alias.xml \ diff --git a/lib/inets/doc/src/httpd.xml b/lib/inets/doc/src/httpd.xml index e40660ab39..435f99ee23 100644 --- a/lib/inets/doc/src/httpd.xml +++ b/lib/inets/doc/src/httpd.xml @@ -204,7 +204,15 @@

Limit properties

- + + + + {customize, atom()} + +

A callback module to customize the inets HTTP servers behaviour + see httpd_custom_api

+
+ {disable_chunked_transfer_encoding_send, boolean()} diff --git a/lib/inets/doc/src/httpd_custom_api.xml b/lib/inets/doc/src/httpd_custom_api.xml new file mode 100644 index 0000000000..faf1d277df --- /dev/null +++ b/lib/inets/doc/src/httpd_custom_api.xml @@ -0,0 +1,63 @@ + + + + +
+ + 20152015 + Ericsson AB. All Rights Reserved. + + + The contents of this file are subject to the Erlang Public License, + Version 1.1, (the "License"); you may not use this file except in + compliance with the License. You should have received a copy of the + Erlang Public License along with this software. If not, it can be + retrieved online at http://www.erlang.org/. + + Software distributed under the License is distributed on an "AS IS" + basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + the License for the specific language governing rights and limitations + under the License. + + + + httpd_custom_api + httpd_custom_api.xml +
+ httpd_custom_api + Behaviour with optional callbacks to customize the inets HTTP server. + +

The module implementing this behaviour shall be supplied to to the servers + configuration with the option customize

+ +
+ + + response_header({HeaderName, HeaderValue}) -> {true, Header} | false + Filter and possible alter HTTP response headers. + + Header = {HeaderName :: string(), HeaderValue::string()} + The header name will be in lower case and should not be altered. + + +

Filter and possible alter HTTP response headers before they are sent to the client. +

+
+
+ + + request_header({HeaderName, HeaderValue}) -> {true, Header} | false + Filter and possible alter HTTP request headers. + + Header = {HeaderName :: string(), HeaderValue::string()} + The header name will be in lower case and should not be altered. + + +

Filter and possible alter HTTP request headers before they are processed by the server. +

+
+
+
+
+ + diff --git a/lib/inets/doc/src/ref_man.xml b/lib/inets/doc/src/ref_man.xml index aaedf330b4..3afb020431 100644 --- a/lib/inets/doc/src/ref_man.xml +++ b/lib/inets/doc/src/ref_man.xml @@ -4,7 +4,7 @@
- 19972013 + 19972015 Ericsson AB. All Rights Reserved. @@ -39,6 +39,7 @@ + -- cgit v1.2.3 From 69f114203690b84d7261b68b1893cb578536eca9 Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Mon, 1 Jun 2015 12:06:48 +0200 Subject: Update release notes --- lib/inets/doc/src/notes.xml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'lib/inets/doc/src') diff --git a/lib/inets/doc/src/notes.xml b/lib/inets/doc/src/notes.xml index bae8e327a3..f563a8c4b0 100644 --- a/lib/inets/doc/src/notes.xml +++ b/lib/inets/doc/src/notes.xml @@ -32,7 +32,23 @@ notes.xml
-
Inets 5.10.8 +
Inets 5.10.9 + +
Improvements and New Features + + +

+ Add behaviour with optional callbacks to customize the + inets HTTP server.

+

+ Own Id: OTP-12776

+
+
+
+ +
+ +
Inets 5.10.8
Fixed Bugs and Malfunctions -- cgit v1.2.3