From 42be0b2a4e2b886c846ab1b63eb2c827d315c053 Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Fri, 25 Nov 2011 15:53:15 +0100 Subject: [PATCH] Use HTTP_HEADER instead of WSF_HEADER (WSF_HEADER is kept for convenience and existing code) --- .../rest/src/contrib/doc/html/html_page.e | 2 +- .../request/rest/src/response/rest_response.e | 2 +- .../src/app/app_account_verify_credential.e | 2 +- .../server/request/rest/tests/src/app/app_test.e | 2 +- .../server/request/rest/tests/src/app_server.e | 4 ++-- .../hello_routed_world/src/hello_routed_world.e | 4 ++-- examples/restbucks/src/resource/order_handler.e | 8 ++++---- examples/restbucks/src/restbucks_server.e | 2 +- .../src/misc/request_resource_handler_helper.e | 16 ++++++++-------- .../router/src/request_file_system_handler.e | 10 +++++----- library/server/wsf/src/support/wsf_header.e | 2 ++ library/server/wsf/src/wsf_response.e | 2 +- 12 files changed, 29 insertions(+), 27 deletions(-) diff --git a/draft/library/server/request/rest/src/contrib/doc/html/html_page.e b/draft/library/server/request/rest/src/contrib/doc/html/html_page.e index dcacceba..6b3bf0a0 100644 --- a/draft/library/server/request/rest/src/contrib/doc/html/html_page.e +++ b/draft/library/server/request/rest/src/contrib/doc/html/html_page.e @@ -31,7 +31,7 @@ feature {NONE} -- Initialization feature -- Access - headers: WSF_HEADER + headers: HTTP_HEADER feature -- Recycle diff --git a/draft/library/server/request/rest/src/response/rest_response.e b/draft/library/server/request/rest/src/response/rest_response.e index 04f748bb..a9221271 100644 --- a/draft/library/server/request/rest/src/response/rest_response.e +++ b/draft/library/server/request/rest/src/response/rest_response.e @@ -32,7 +32,7 @@ feature -- Recycle feature -- Access - headers: WSF_HEADER + headers: HTTP_HEADER api: STRING -- Associated api query string. diff --git a/draft/library/server/request/rest/tests/src/app/app_account_verify_credential.e b/draft/library/server/request/rest/tests/src/app/app_account_verify_credential.e index 419aceea..00de5b16 100644 --- a/draft/library/server/request/rest/tests/src/app/app_account_verify_credential.e +++ b/draft/library/server/request/rest/tests/src/app/app_account_verify_credential.e @@ -55,7 +55,7 @@ feature -- Execution execute_application (ctx: APP_REQUEST_HANDLER_CONTEXT; req: WSF_REQUEST; res: WSF_RESPONSE) local l_full: BOOLEAN - h: WSF_HEADER + h: HTTP_HEADER l_login: STRING_8 s: STRING content_type_supported: ARRAY [STRING] diff --git a/draft/library/server/request/rest/tests/src/app/app_test.e b/draft/library/server/request/rest/tests/src/app/app_test.e index 384de7d6..7ad0960a 100644 --- a/draft/library/server/request/rest/tests/src/app/app_test.e +++ b/draft/library/server/request/rest/tests/src/app/app_test.e @@ -42,7 +42,7 @@ feature -- Execution -- Execute request handler local s: STRING - h: WSF_HEADER + h: HTTP_HEADER do create h.make h.put_content_type_text_plain diff --git a/draft/library/server/request/rest/tests/src/app_server.e b/draft/library/server/request/rest/tests/src/app_server.e index b5ac30f1..ec211259 100644 --- a/draft/library/server/request/rest/tests/src/app_server.e +++ b/draft/library/server/request/rest/tests/src/app_server.e @@ -78,7 +78,7 @@ feature -- Execution local rqst_uri: detachable STRING l_path_info: detachable STRING - h: WSF_HEADER + h: HTTP_HEADER s: STRING l_redir_url: STRING do @@ -108,7 +108,7 @@ feature -- Implementation -- execute_exception_trace (ctx: like new_request_context) -- local --- h: WSF_HEADER +-- h: HTTP_HEADER -- s: STRING -- do -- create h.make diff --git a/examples/hello_routed_world/src/hello_routed_world.e b/examples/hello_routed_world/src/hello_routed_world.e index 8d607ebc..544a49aa 100644 --- a/examples/hello_routed_world/src/hello_routed_world.e +++ b/examples/hello_routed_world/src/hello_routed_world.e @@ -84,7 +84,7 @@ feature -- Execution execute_default (req: WSF_REQUEST; res: WSF_RESPONSE) local - h: WSF_HEADER + h: HTTP_HEADER l_url: STRING e: EXECUTION_ENVIRONMENT n: INTEGER @@ -171,7 +171,7 @@ feature -- Execution execute_hello (req: WSF_REQUEST; res: WSF_RESPONSE; a_name: detachable READABLE_STRING_32; ctx: REQUEST_HANDLER_CONTEXT) local l_response_content_type: detachable STRING - h: WSF_HEADER + h: HTTP_HEADER content_type_supported: ARRAY [STRING] l_body: STRING_8 do diff --git a/examples/restbucks/src/resource/order_handler.e b/examples/restbucks/src/resource/order_handler.e index a747ee3a..850b60e7 100644 --- a/examples/restbucks/src/resource/order_handler.e +++ b/examples/restbucks/src/resource/order_handler.e @@ -76,7 +76,7 @@ feature -- HTTP Methods compute_response_get (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE; l_order : ORDER) local - h: WSF_HEADER + h: HTTP_HEADER l_msg : STRING etag_utils : ETAG_UTILS do @@ -152,7 +152,7 @@ feature -- HTTP Methods compute_response_put (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE; l_order : ORDER) local - h: WSF_HEADER + h: HTTP_HEADER joc : JSON_ORDER_CONVERTER etag_utils : ETAG_UTILS do @@ -205,7 +205,7 @@ feature -- HTTP Methods compute_response_delete (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE) local - h : WSF_HEADER + h : HTTP_HEADER do create h.make h.put_status ({HTTP_STATUS_CODE}.no_content) @@ -241,7 +241,7 @@ feature -- HTTP Methods compute_response_post (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE; l_order : ORDER) local - h: WSF_HEADER + h: HTTP_HEADER l_msg : STRING l_location : STRING joc : JSON_ORDER_CONVERTER diff --git a/examples/restbucks/src/restbucks_server.e b/examples/restbucks/src/restbucks_server.e index 10356e91..e6ffb8d5 100644 --- a/examples/restbucks/src/restbucks_server.e +++ b/examples/restbucks/src/restbucks_server.e @@ -48,7 +48,7 @@ feature -- Execution -- in the case that the given uri does not have a corresponding http method -- to handle it. local - h : WSF_HEADER + h : HTTP_HEADER l_description : STRING l_api_doc : STRING do diff --git a/library/server/request/router/src/misc/request_resource_handler_helper.e b/library/server/request/router/src/misc/request_resource_handler_helper.e index 2ef66148..220cb8ca 100644 --- a/library/server/request/router/src/misc/request_resource_handler_helper.e +++ b/library/server/request/router/src/misc/request_resource_handler_helper.e @@ -169,7 +169,7 @@ feature -- Handle responses handle_bad_request_response (a_description: STRING; ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE ) local - h : WSF_HEADER + h : HTTP_HEADER do create h.make h.put_status ({HTTP_STATUS_CODE}.bad_request) @@ -184,7 +184,7 @@ feature -- Handle responses handle_precondition_fail_response (a_description: STRING; ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE ) local - h : WSF_HEADER + h : HTTP_HEADER do create h.make h.put_status ({HTTP_STATUS_CODE}.precondition_failed) @@ -198,7 +198,7 @@ feature -- Handle responses handle_internal_server_error (a_description: STRING; ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE ) local - h : WSF_HEADER + h : HTTP_HEADER do create h.make h.put_status ({HTTP_STATUS_CODE}.internal_server_error) @@ -212,7 +212,7 @@ feature -- Handle responses handle_not_implemented (a_description: STRING; ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE ) local - h : WSF_HEADER + h : HTTP_HEADER do create h.make h.put_status ({HTTP_STATUS_CODE}.not_implemented) @@ -226,7 +226,7 @@ feature -- Handle responses handle_method_not_allowed_response (a_description: STRING; ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE) local - h : WSF_HEADER + h : HTTP_HEADER do create h.make h.put_status ({HTTP_STATUS_CODE}.method_not_allowed) @@ -240,7 +240,7 @@ feature -- Handle responses handle_resource_not_found_response (a_description: STRING; ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE) local - h : WSF_HEADER + h : HTTP_HEADER do create h.make h.put_status ({HTTP_STATUS_CODE}.not_found) @@ -255,7 +255,7 @@ feature -- Handle responses handle_resource_not_modified_response (a_description: STRING; ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE) local - h : WSF_HEADER + h : HTTP_HEADER do res.flush create h.make @@ -271,7 +271,7 @@ feature -- Handle responses handle_resource_conflict_response (a_description: STRING; ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE) local - h : WSF_HEADER + h : HTTP_HEADER do create h.make h.put_status ({HTTP_STATUS_CODE}.conflict) diff --git a/library/server/request/router/src/request_file_system_handler.e b/library/server/request/router/src/request_file_system_handler.e index b7512797..9f6267ca 100644 --- a/library/server/request/router/src/request_file_system_handler.e +++ b/library/server/request/router/src/request_file_system_handler.e @@ -48,7 +48,7 @@ feature -- Execution execute (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE) -- Execute request handler local - h: WSF_HEADER + h: HTTP_HEADER s: STRING uri: STRING do @@ -92,7 +92,7 @@ feature -- Execution respond_index (a_uri: READABLE_STRING_8; dn: READABLE_STRING_8; ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE) local - h: WSF_HEADER + h: HTTP_HEADER uri, s: STRING_8 d: DIRECTORY l_files: LIST [STRING_8] @@ -148,7 +148,7 @@ feature -- Execution respond_file (f: FILE; ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE) local fn: READABLE_STRING_8 - h: WSF_HEADER + h: HTTP_HEADER ext: READABLE_STRING_8 ct: detachable READABLE_STRING_8 do @@ -177,7 +177,7 @@ feature -- Execution respond_not_found (uri: READABLE_STRING_8; ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE) local - h: WSF_HEADER + h: HTTP_HEADER s: STRING_8 do create h.make @@ -193,7 +193,7 @@ feature -- Execution respond_access_denied (uri: READABLE_STRING_8; ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE) local - h: WSF_HEADER + h: HTTP_HEADER s: STRING_8 do create h.make diff --git a/library/server/wsf/src/support/wsf_header.e b/library/server/wsf/src/support/wsf_header.e index faffddcb..6ad59a0d 100644 --- a/library/server/wsf/src/support/wsf_header.e +++ b/library/server/wsf/src/support/wsf_header.e @@ -22,6 +22,8 @@ note class WSF_HEADER +obsolete "Use HTTP_HEADER [2011-nov-25]" + inherit HTTP_HEADER diff --git a/library/server/wsf/src/wsf_response.e b/library/server/wsf/src/wsf_response.e index effeefee..1628a2a3 100644 --- a/library/server/wsf/src/wsf_response.e +++ b/library/server/wsf/src/wsf_response.e @@ -91,7 +91,7 @@ feature -- Header output operation status_not_set: not status_is_set header_not_committed: not header_committed local - h: WSF_HEADER + h: HTTP_HEADER i,n: INTEGER do set_status_code (a_status_code)