Files
EWF/library/server/wsf/extension/handler/wsf_debug_handler.e
Jocelyn Fiat 30a5e087ae Web form:
- Improvement about web form manipulation (remove a field, set a text value to input fields by name, ...)
 - Improved web form html generation, especially for select and type checkbox
 - Updated the date input field interface with a new set_date_value .

File response:
 - "application/force-download" is not a standard MIME content type, so use "application_octet_stream" instead as default.

Standalone connector:
 - Added expected creation procedure for the service launcher.
 - Added new "secure_port" configuration variable, for SSL standalone service.
   This way, if `is_secure` is True, the server will use `secure_port` (overrides `port` value).

Date:
 - Improved support for RFC 3339 (a profile of ISO 8601)

Removed obsolete and warnings:
 - removed usage of FILE_NAME
 - updated code to avoid implicit conversion from STRING_32 to STRING_8
 - avoid uneed conversion to STRING_8 (when possible)
2020-10-02 15:02:06 +02:00

124 lines
2.7 KiB
Plaintext

note
description: "Handler returning debug information."
date: "$Date$"
revision: "$Revision$"
class
WSF_DEBUG_HANDLER
inherit
WSF_STARTS_WITH_HANDLER
rename
execute as execute_starts_with
end
WSF_SELF_DOCUMENTED_HANDLER
create
make,
make_hidden
feature {NONE} -- Initialization
make
do
end
make_hidden
do
make
is_hidden := True
end
is_hidden: BOOLEAN
-- Current mapped handler should be hidden from self documentation
feature -- Documentation
mapping_documentation (m: WSF_ROUTER_MAPPING; a_request_methods: detachable WSF_REQUEST_METHODS): WSF_ROUTER_MAPPING_DOCUMENTATION
-- <Precursor>
do
create Result.make (m)
Result.set_is_hidden (is_hidden)
Result.add_description ("Debug handler (mainly to return request information)")
end
feature -- Access
execute_starts_with (a_path: READABLE_STRING_8; req: WSF_REQUEST; res: WSF_RESPONSE)
local
s: STRING_8
p: WSF_PAGE_RESPONSE
l_len: INTEGER
dbg: WSF_DEBUG_INFORMATION
do
create s.make (2048)
s.append ("= EWF DEBUG =")
s.append ("%N")
create dbg.make
dbg.set_is_verbose (True)
dbg.set_unicode_output_enabled (True)
dbg.append_cgi_variables_to (req, res, s)
dbg.append_information_to (req, res, s)
s.append ("= END =")
s.append ("%N")
create p.make_with_body (s)
if
{PLATFORM}.is_windows and then
attached req.wgi_connector as conn and then
is_cgi_connector (conn)
then
--| FIXME: the CGI connector add %R for any single %N character, so update the Content-Length accordingly.
-- Dirty hack to handle correctly CGI on Windows, since it seems "abc%N" will be sent as "abc%R%N"
l_len := 0
across s as ic loop
if ic.item = '%R' then
l_len := l_len + 1
ic.forth
if
not ic.after and then
ic.item = '%N'
then
l_len := l_len + 1
end
elseif ic.item = '%N' then
l_len := l_len + 2 -- %R will be added by the CGI connector...
else
l_len := l_len + 1
end
end
else
l_len := s.count
end
p.header.put_content_length (l_len)
p.header.put_content_type_utf_8_text_plain
res.send (p)
end
is_cgi_connector (conn: separate WGI_CONNECTOR): BOOLEAN
local
s: STRING
do
create s.make_from_separate (conn.name)
Result := s.is_case_insensitive_equal_general ("cgi")
end
note
copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[
Eiffel Software
5949 Hollister Ave., Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Website http://www.eiffel.com
Customer support http://support.eiffel.com
]"
end