Removed implicit conversion from HTTP_CONTENT_TYPE to STRING_8
because it could be a source of bug due to hidden conversion (and parameters) Applied changes to autotest cases Cosmetic
This commit is contained in:
@@ -16,8 +16,7 @@ create
|
|||||||
make_from_string
|
make_from_string
|
||||||
|
|
||||||
convert
|
convert
|
||||||
make_from_string ({READABLE_STRING_8, STRING_8, IMMUTABLE_STRING_8}),
|
make_from_string ({READABLE_STRING_8, STRING_8, IMMUTABLE_STRING_8})
|
||||||
string: {READABLE_STRING_8}
|
|
||||||
|
|
||||||
feature -- Access
|
feature -- Access
|
||||||
|
|
||||||
|
|||||||
@@ -41,8 +41,7 @@ create
|
|||||||
make_from_string
|
make_from_string
|
||||||
|
|
||||||
convert
|
convert
|
||||||
make_from_string ({READABLE_STRING_8, STRING_8, IMMUTABLE_STRING_8}),
|
make_from_string ({READABLE_STRING_8, STRING_8, IMMUTABLE_STRING_8})
|
||||||
string: {READABLE_STRING_8}
|
|
||||||
|
|
||||||
feature {NONE} -- Initialization
|
feature {NONE} -- Initialization
|
||||||
|
|
||||||
@@ -227,7 +226,7 @@ feature -- Status report
|
|||||||
end
|
end
|
||||||
|
|
||||||
same_simple_type (s: READABLE_STRING_8): BOOLEAN
|
same_simple_type (s: READABLE_STRING_8): BOOLEAN
|
||||||
-- Current has same type/subtype string representation as `s'?
|
-- Current has same type/subtype string representation as `s'?
|
||||||
do
|
do
|
||||||
Result := simple_type.same_string (s)
|
Result := simple_type.same_string (s)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -87,7 +87,6 @@ feature {NONE} -- Implementation
|
|||||||
if p > 0 then
|
if p > 0 then
|
||||||
q := r.index_of ({CHARACTER_32} ']', p + 1)
|
q := r.index_of ({CHARACTER_32} ']', p + 1)
|
||||||
if q > p then
|
if q > p then
|
||||||
-- k32 := url_encoder.decoded_string (k)
|
|
||||||
if attached {WSF_TABLE} ptb.value (k) as l_tb_value then
|
if attached {WSF_TABLE} ptb.value (k) as l_tb_value then
|
||||||
tb := l_tb_value
|
tb := l_tb_value
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ feature {NONE} -- Initialization
|
|||||||
-- Content-Type
|
-- Content-Type
|
||||||
s8 := wgi_request.content_type
|
s8 := wgi_request.content_type
|
||||||
if s8 /= Void then
|
if s8 /= Void then
|
||||||
content_type := s8
|
create content_type.make_from_string (s8)
|
||||||
else
|
else
|
||||||
content_type := Void
|
content_type := Void
|
||||||
end
|
end
|
||||||
@@ -1111,7 +1111,7 @@ feature -- Form fields and related
|
|||||||
|
|
||||||
feature -- Access: MIME handler
|
feature -- Access: MIME handler
|
||||||
|
|
||||||
has_mime_handler (a_content_type: READABLE_STRING_8): BOOLEAN
|
has_mime_handler (a_content_type: HTTP_CONTENT_TYPE): BOOLEAN
|
||||||
-- Has a MIME handler registered for `a_content_type'?
|
-- Has a MIME handler registered for `a_content_type'?
|
||||||
do
|
do
|
||||||
if attached mime_handlers as hdls then
|
if attached mime_handlers as hdls then
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ feature {NONE} -- Initialization
|
|||||||
-- Initialize `Current'.
|
-- Initialize `Current'.
|
||||||
do
|
do
|
||||||
set_service_option ("port", 9091)
|
set_service_option ("port", 9091)
|
||||||
|
set_service_option ("verbose", True)
|
||||||
make_and_launch
|
make_and_launch
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ feature {NONE} -- Events
|
|||||||
wt: WORKER_THREAD
|
wt: WORKER_THREAD
|
||||||
e: EXECUTION_ENVIRONMENT
|
e: EXECUTION_ENVIRONMENT
|
||||||
do
|
do
|
||||||
|
-- port_number := 9091
|
||||||
port_number := 0
|
port_number := 0
|
||||||
base_url := "test/"
|
base_url := "test/"
|
||||||
create app.make_custom (to_wgi_service, base_url)
|
create app.make_custom (to_wgi_service, base_url)
|
||||||
@@ -50,11 +51,41 @@ feature {NONE} -- Events
|
|||||||
port_number := app.port
|
port_number := app.port
|
||||||
end
|
end
|
||||||
|
|
||||||
|
server_log_name: STRING
|
||||||
|
local
|
||||||
|
fn: FILE_NAME
|
||||||
|
once
|
||||||
|
create fn.make_from_string ("..")
|
||||||
|
fn.extend ("..")
|
||||||
|
fn.extend ("..")
|
||||||
|
fn.extend ("..")
|
||||||
|
fn.extend ("..")
|
||||||
|
fn.extend ("server_test.log")
|
||||||
|
Result := fn.string
|
||||||
|
end
|
||||||
|
|
||||||
|
server_log (m: STRING_8)
|
||||||
|
local
|
||||||
|
f: RAW_FILE
|
||||||
|
do
|
||||||
|
create f.make_open_append (server_log_name)--"..\server-tests.log")
|
||||||
|
f.put_string (m)
|
||||||
|
f.put_character ('%N')
|
||||||
|
f.close
|
||||||
|
end
|
||||||
|
|
||||||
execute (req: WSF_REQUEST; res: WSF_RESPONSE)
|
execute (req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||||
local
|
local
|
||||||
q: detachable STRING_32
|
q: detachable STRING_32
|
||||||
page: WSF_PAGE_RESPONSE
|
page: WSF_PAGE_RESPONSE
|
||||||
do
|
do
|
||||||
|
debug
|
||||||
|
server_log (req.request_uri)
|
||||||
|
if attached req.content_type as l_content_type then
|
||||||
|
server_log ("content_type:" + l_content_type.string)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
create page.make
|
create page.make
|
||||||
if attached req.request_uri as l_uri then
|
if attached req.request_uri as l_uri then
|
||||||
if l_uri.starts_with (test_url ("get/01")) then
|
if l_uri.starts_with (test_url ("get/01")) then
|
||||||
@@ -93,17 +124,24 @@ feature {NONE} -- Events
|
|||||||
end
|
end
|
||||||
|
|
||||||
create q.make_empty
|
create q.make_empty
|
||||||
|
-- req.set_raw_input_data_recorded (True)
|
||||||
|
|
||||||
across
|
across
|
||||||
req.form_parameters as fcur
|
req.form_parameters as fcur
|
||||||
loop
|
loop
|
||||||
|
debug
|
||||||
|
server_log ("%Tform: " + fcur.item.name)
|
||||||
|
end
|
||||||
if not q.is_empty then
|
if not q.is_empty then
|
||||||
q.append_character ('&')
|
q.append_character ('&')
|
||||||
end
|
end
|
||||||
q.append (fcur.item.name.as_string_32 + "=" + fcur.item.as_string)
|
q.append (fcur.item.name.as_string_32 + "=" + fcur.item.as_string)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- if attached req.raw_input_data as d then
|
||||||
|
-- server_log ("Raw data=" + d)
|
||||||
|
-- end
|
||||||
|
|
||||||
if not q.is_empty then
|
if not q.is_empty then
|
||||||
page.put_string (" : " + q )
|
page.put_string (" : " + q )
|
||||||
end
|
end
|
||||||
@@ -154,6 +192,7 @@ feature {NONE} -- Events
|
|||||||
http_session := sess
|
http_session := sess
|
||||||
sess.set_timeout (-1)
|
sess.set_timeout (-1)
|
||||||
sess.set_connect_timeout (-1)
|
sess.set_connect_timeout (-1)
|
||||||
|
-- sess.set_proxy ("127.0.0.1", 8888) --| inspect traffic with http://www.fiddler2.com/
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ feature {NONE} -- Helpers
|
|||||||
do
|
do
|
||||||
Result := Precursor (ctx)
|
Result := Precursor (ctx)
|
||||||
Result.headers.extend ("chunked", "Transfer-Encoding")
|
Result.headers.extend ("chunked", "Transfer-Encoding")
|
||||||
-- Result.set_proxy ("127.0.0.1", 8888) --| inspect traffic with http://www.fiddler2.com/
|
|
||||||
end
|
end
|
||||||
|
|
||||||
feature -- Test routines
|
feature -- Test routines
|
||||||
|
|||||||
Reference in New Issue
Block a user