Better support for unicode path and values.

Added WSF_REQUEST.percent_encoded_path_info: READABLE_STRING_8
    to keep url encoded path info, as it is useful for specific component

The router is now using WSF_REQUEST.percent_encoded_path_info
    since URI_TEMPLATE are handling URI (and not IRI)
    this fixes an issue with unicode path parameters.

This should not break existing code, and this fixes various unicode related issues related
   to PATH parameter and path info
   but also any component using file names.

(required EiffelStudio >= 7.2)
This commit is contained in:
2013-06-12 18:00:55 +02:00
parent a982286dd4
commit cc4ef1a575
28 changed files with 1056 additions and 449 deletions

View File

@@ -15,7 +15,7 @@ class
WSF_SERVICE_LAUNCHER_OPTIONS
inherit
ANY
TABLE_ITERABLE [detachable ANY, READABLE_STRING_GENERAL]
redefine
default_create
end
@@ -23,7 +23,8 @@ inherit
create
default_create,
make,
make_from_array
make_from_array,
make_from_iterable
convert
make_from_array ({ARRAY [TUPLE [name: READABLE_STRING_GENERAL; value: detachable ANY]]})
@@ -44,6 +45,19 @@ feature {NONE} -- Initialization
make_from_array (a_options: ARRAY [TUPLE [name: READABLE_STRING_GENERAL; value: detachable ANY]])
do
make
append_array_of_options (a_options)
end
make_from_iterable (a_options: TABLE_ITERABLE [detachable ANY, READABLE_STRING_GENERAL])
do
make
append_options (a_options)
end
feature -- Merging
append_array_of_options (a_options: ARRAY [TUPLE [name: READABLE_STRING_GENERAL; value: detachable ANY]])
do
across
a_options as opt
loop
@@ -53,6 +67,15 @@ feature {NONE} -- Initialization
end
end
append_options (a_options: TABLE_ITERABLE [detachable ANY, READABLE_STRING_GENERAL])
do
across
a_options as o
loop
set_option (o.key, o.item)
end
end
feature -- Access
option (a_name: READABLE_STRING_GENERAL): detachable ANY
@@ -60,6 +83,14 @@ feature -- Access
Result := options.item (a_name)
end
feature -- Access
new_cursor: TABLE_ITERATION_CURSOR [detachable ANY, READABLE_STRING_GENERAL]
-- Fresh cursor associated with current structure
do
Result := options.new_cursor
end
feature -- Element change
set_option (a_name: READABLE_STRING_GENERAL; a_value: detachable ANY)
@@ -75,13 +106,13 @@ feature -- Element change
feature {NONE} -- Implementation
options: HASH_TABLE [detachable ANY, READABLE_STRING_GENERAL]
options: STRING_TABLE [detachable ANY]
-- Custom options which might be support (or not) by the default service
invariant
options_attached: options /= Void
note
copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[
Eiffel Software

View File

@@ -11,28 +11,40 @@ inherit
WSF_SERVICE_LAUNCHER_OPTIONS
create
make_from_file
make_from_file,
make_from_file_and_defaults
feature {NONE} -- Initialization
make_from_file (a_filename: READABLE_STRING_32)
make_from_file (a_filename: READABLE_STRING_GENERAL)
-- Initialize `Current'.
do
make
import (a_filename)
end
make_from_file_and_defaults (a_filename: READABLE_STRING_GENERAL; dft: detachable WSF_SERVICE_LAUNCHER_OPTIONS)
-- Initialize `Current'.
do
make
if dft /= Void then
append_options (dft)
end
import (a_filename)
end
feature {NONE} -- Implementation
import (a_filename: READABLE_STRING_32)
import (a_filename: READABLE_STRING_GENERAL)
-- Import ini file content
local
f: PLAIN_TEXT_FILE
l,v: STRING_8
p: INTEGER
do
--FIXME: handle unicode filename here.
create f.make (a_filename)
create f.make_with_name (a_filename)
if f.exists and f.is_readable then
f.open_read
from
@@ -60,7 +72,7 @@ feature {NONE} -- Implementation
end
note
copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[
Eiffel Software