Simplified EWSGI interfaces
Renamed WGI_RESPONSE_BUFFER as WGI_RESPONSE to avoid confusion
Removed EWF_HEADER and removed related caller from WGI implementation,
now this is only part of WSF library
Added wgi_version, wgi_implementation and wgi_connector to the WGI_REQUEST interface
to give more information to the user
Added back WGI_CONNECTOR to WGI specification, mainly because of `{WGI_REQUEST}.wgi_connector'
simplified WGI_CONNECTOR to contain for now only `name' and `version'
if the implementation of connector inherit from WGI_CONNECTOR (recommended)
this might gives more access to the user using a reverse assignment for specific needs
(but this usage is not recommended due to portability issue on other connector)
Removed useless connector.ecf since now EWF/WGI library provides the helper classes
This commit is contained in:
@@ -19,10 +19,11 @@ create
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make (a_vars: HASH_TABLE [READABLE_STRING_8, READABLE_STRING_8]; a_input: like input)
|
||||
make (a_vars: HASH_TABLE [READABLE_STRING_8, READABLE_STRING_8]; a_input: like input; a_wgi_connector: like wgi_connector)
|
||||
require
|
||||
vars_attached: a_vars /= Void
|
||||
do
|
||||
wgi_connector := a_wgi_connector
|
||||
input := a_input
|
||||
set_meta_variables (a_vars)
|
||||
|
||||
@@ -34,6 +35,14 @@ feature -- Access: Input
|
||||
input: WGI_INPUT_STREAM
|
||||
-- Server input channel
|
||||
|
||||
feature -- EWSGI access
|
||||
|
||||
wgi_version: STRING = "0.1"
|
||||
|
||||
wgi_implementation: STRING = "Eiffel Web Framework 0.1"
|
||||
|
||||
wgi_connector: WGI_CONNECTOR
|
||||
|
||||
feature -- Access: CGI meta parameters
|
||||
|
||||
meta_variables: HASH_TABLE [READABLE_STRING_8, READABLE_STRING_8]
|
||||
|
||||
+4
-27
@@ -1,17 +1,16 @@
|
||||
note
|
||||
description: "[
|
||||
Response buffer
|
||||
WGI Response implemented using stream buffer
|
||||
|
||||
]"
|
||||
specification: "EWSGI specification https://github.com/Eiffel-World/Eiffel-Web-Framework/wiki/EWSGI-specification"
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
WGI_RESPONSE_STREAM_BUFFER
|
||||
WGI_RESPONSE_STREAM
|
||||
|
||||
inherit
|
||||
WGI_RESPONSE_BUFFER
|
||||
WGI_RESPONSE
|
||||
|
||||
create
|
||||
make
|
||||
@@ -76,34 +75,12 @@ feature -- Status setting
|
||||
|
||||
feature -- Header output operation
|
||||
|
||||
write_headers_string (a_headers: READABLE_STRING_8)
|
||||
write_headers (a_headers: READABLE_STRING_8)
|
||||
do
|
||||
write (a_headers)
|
||||
header_committed := True
|
||||
end
|
||||
|
||||
write_header (a_status_code: INTEGER; a_headers: detachable ARRAY [TUPLE [key: READABLE_STRING_8; value: READABLE_STRING_8]])
|
||||
-- Send headers with status `a_status', and headers from `a_headers'
|
||||
local
|
||||
h: EWF_HEADER
|
||||
i,n: INTEGER
|
||||
do
|
||||
set_status_code (a_status_code)
|
||||
create h.make
|
||||
if a_headers /= Void then
|
||||
from
|
||||
i := a_headers.lower
|
||||
n := a_headers.upper
|
||||
until
|
||||
i > n
|
||||
loop
|
||||
h.put_header_key_value (a_headers[i].key, a_headers[i].value)
|
||||
i := i + 1
|
||||
end
|
||||
end
|
||||
write_headers_string (h.string)
|
||||
end
|
||||
|
||||
feature -- Output operation
|
||||
|
||||
write_string (s: READABLE_STRING_8)
|
||||
Reference in New Issue
Block a user