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

@@ -10,6 +10,11 @@ class
inherit
WSF_SESSION
SHARED_EXECUTION_ENVIRONMENT
export
{NONE} all
end
create
make,
make_new
@@ -128,15 +133,6 @@ feature {NONE} -- Storage
data.compare_objects
end
sessions_folder_name: READABLE_STRING_8
local
dn: DIRECTORY_NAME
once
create dn.make_from_string ((create {EXECUTION_ENVIRONMENT}).current_working_directory)
dn.extend ("_sessions_")
Result := dn.string
end
load
do
if manager.session_exists (uuid) then
@@ -181,7 +177,7 @@ feature {NONE} -- Implementation
end
note
copyright: "Copyright (c) 1984-2012, 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

@@ -21,12 +21,12 @@ feature {NONE} -- Initialization
make_with_folder ("_WSF_SESSIONS_")
end
make_with_folder (a_folder: like sessions_folder_name)
make_with_folder (a_folder: READABLE_STRING_GENERAL)
do
sessions_folder_name := a_folder
create sessions_folder_name.make_from_string (a_folder)
end
sessions_folder_name: STRING_8
sessions_folder_name: PATH
feature -- Access
@@ -34,7 +34,7 @@ feature -- Access
local
f: RAW_FILE
do
create f.make (file_name (a_session_uuid))
create f.make_with_path (file_name (a_session_uuid))
Result := f.exists and then f.is_readable
end
@@ -42,7 +42,7 @@ feature -- Access
local
f: RAW_FILE
do
create f.make (file_name (a_session_uuid))
create f.make_with_path (file_name (a_session_uuid))
if f.exists and then f.is_readable then
f.open_read
if attached data_from_file (f) as d then
@@ -68,7 +68,7 @@ feature -- Persistence
delete_session (a_session)
else
ensure_session_folder_exists
create f.make (file_name (a_session.uuid))
create f.make_with_path (file_name (a_session.uuid))
if not f.exists or else f.is_writable then
f.create_read_write
a_session.data.set_expiration (a_session.expiration)
@@ -91,7 +91,7 @@ feature -- Persistence
rescued: BOOLEAN
do
if not rescued then
create f.make (file_name (a_session.uuid))
create f.make_with_path (file_name (a_session.uuid))
if f.exists then
f.delete
end
@@ -131,7 +131,7 @@ feature {NONE} -- Implementation
local
d: DIRECTORY
once
create d.make (sessions_folder_name)
create d.make_with_path (sessions_folder_name)
if not d.exists then
d.recursive_create_dir
end
@@ -143,18 +143,13 @@ feature {NONE} -- Implementation
local
d: DIRECTORY
do
create d.make (sessions_folder_name)
create d.make_with_path (sessions_folder_name)
Result := d.exists and then d.is_writable
end
file_name (a_uuid: like {WSF_SESSION}.uuid): READABLE_STRING_8
local
fn: FILE_NAME
file_name (a_uuid: like {WSF_SESSION}.uuid): PATH
do
create fn.make_from_string (sessions_folder_name)
fn.set_file_name (a_uuid.out)
fn.add_extension ("session")
Result := fn.string
Result := sessions_folder_name.extended (a_uuid.out).appended_with_extension ("session")
end
note