diff --git a/ext/server/nino b/ext/server/nino index 9fef2d71..58767bb1 160000 --- a/ext/server/nino +++ b/ext/server/nino @@ -1 +1 @@ -Subproject commit 9fef2d71f053c32c9e4c55984d53ebefe7a02c15 +Subproject commit 58767bb1c13e660ba446c3d83493b458105976e1 diff --git a/library/client/http_client/src/http_client_request.e b/library/client/http_client/src/http_client_request.e index edb36b5d..597ce816 100644 --- a/library/client/http_client/src/http_client_request.e +++ b/library/client/http_client/src/http_client_request.e @@ -59,17 +59,17 @@ feature -- Authentication Result := session.auth_type_id end - username: detachable READABLE_STRING_8 + username: detachable READABLE_STRING_32 do Result := session.username end - password: detachable READABLE_STRING_8 + password: detachable READABLE_STRING_32 do Result := session.password end - credentials: detachable READABLE_STRING_8 + credentials: detachable READABLE_STRING_32 do Result := session.credentials end diff --git a/library/client/http_client/src/http_client_request_context.e b/library/client/http_client/src/http_client_request_context.e index 8ffd0e9d..77a3cdcb 100644 --- a/library/client/http_client/src/http_client_request_context.e +++ b/library/client/http_client/src/http_client_request_context.e @@ -8,7 +8,8 @@ class HTTP_CLIENT_REQUEST_CONTEXT create - make + make, + make_with_credentials_required feature {NONE} -- Initialization @@ -19,6 +20,12 @@ feature {NONE} -- Initialization create form_data_parameters.make (10) end + make_with_credentials_required + do + make + set_credentials_required (True) + end + feature -- Settings credentials_required: BOOLEAN @@ -40,6 +47,16 @@ feature -- Status report feature -- Element change + add_query_parameter (k: READABLE_STRING_8; v: READABLE_STRING_32) + do + query_parameters.force (v, k) + end + + add_form_data_parameter (k: READABLE_STRING_8; v: READABLE_STRING_32) + do + form_data_parameters.force (v, k) + end + set_credentials_required (b: BOOLEAN) do credentials_required := b diff --git a/library/client/http_client/src/http_client_session.e b/library/client/http_client/src/http_client_session.e index 964958f5..5bb77b74 100644 --- a/library/client/http_client/src/http_client_session.e +++ b/library/client/http_client/src/http_client_session.e @@ -92,12 +92,17 @@ feature -- Authentication -- See {HTTP_CLIENT_CONSTANTS}.Auth_type_* username, - password: detachable READABLE_STRING_8 + password: detachable READABLE_STRING_32 - credentials: detachable READABLE_STRING_8 + credentials: detachable READABLE_STRING_32 feature -- Change + set_base_url (u: like base_url) + do + base_url := u + end + set_timeout (n: like timeout) do timeout := n @@ -113,6 +118,11 @@ feature -- Change headers.force (v, k) end + remove_header (k: READABLE_STRING_8) + do + headers.prune (k) + end + set_credentials (u: like username; p: like password) do username := u diff --git a/library/server/ewsgi/connectors/nino/src/ewf_nino_connector.e b/library/server/ewsgi/connectors/nino/src/ewf_nino_connector.e index 519a3a15..a5891067 100644 --- a/library/server/ewsgi/connectors/nino/src/ewf_nino_connector.e +++ b/library/server/ewsgi/connectors/nino/src/ewf_nino_connector.e @@ -20,9 +20,11 @@ create feature {NONE} -- Initialization make_with_base (a_app: like application; a_base: like base) + require + a_base_starts_with_slash: (a_base /= Void and then not a_base.is_empty) implies a_base.starts_with ("/") do make (a_app) - base := a_base + set_base (a_base) end feature {NONE} -- Initialization @@ -52,8 +54,12 @@ feature -- Access feature -- Element change set_base (b: like base) + require + b_starts_with_slash: (b /= Void and then not b.is_empty) implies b.starts_with ("/") do base := b + ensure + valid_base: (attached base as l_base and then not l_base.is_empty) implies l_base.starts_with ("/") end feature -- Server diff --git a/library/server/ewsgi/connectors/nino/src/ewf_nino_handler.e b/library/server/ewsgi/connectors/nino/src/ewf_nino_handler.e index 909611ac..d6ac6d0d 100644 --- a/library/server/ewsgi/connectors/nino/src/ewf_nino_handler.e +++ b/library/server/ewsgi/connectors/nino/src/ewf_nino_handler.e @@ -64,8 +64,16 @@ feature -- Request processing until a_headers_map.after loop - vn := "HTTP_" + a_headers_map.key_for_iteration.as_upper + create vn.make_from_string (a_headers_map.key_for_iteration.as_upper) vn.replace_substring_all ("-", "_") + if + vn.starts_with ("CONTENT_") and then + (vn.same_string_general ({WGI_META_NAMES}.content_type) or vn.same_string_general ({WGI_META_NAMES}.content_length)) + then + --| Keep this name + else + vn.prepend ("HTTP_") + end add_environment_variable (a_headers_map.item_for_iteration, vn, env) a_headers_map.forth end @@ -90,6 +98,8 @@ feature -- Request processing l_server_name := l_host l_server_port := "80" -- Default end + else + check host_available: False end end if attached a_headers_map.item ("Authorization") as l_authorization then diff --git a/library/server/ewsgi/default/nino/nino_application.e b/library/server/ewsgi/default/nino/nino_application.e index 278fc990..1d18f11f 100644 --- a/library/server/ewsgi/default/nino/nino_application.e +++ b/library/server/ewsgi/default/nino/nino_application.e @@ -20,6 +20,8 @@ feature {NONE} -- Implementation make_custom (a_callback: like {WGI_AGENT_APPLICATION}.callback; a_base_url: detachable STRING) -- Initialize `Current'. + require + base_url_starts_with_slash: (a_base_url /= Void and then not a_base_url.is_empty) implies a_base_url.starts_with ("/") local app: WGI_AGENT_APPLICATION do