Commit Graph

75 Commits

Author SHA1 Message Date
Jocelyn Fiat
40ea982293 Added ANSI C date time string format support in HTTP_DATE. 2013-01-31 15:30:39 +01:00
Jocelyn Fiat
20d5798444 Added HTTP_DATE to ease http date manipulation and optimize code rather than using EiffelTime's code facilities.
Added autotests to `http' lib.
2013-01-31 11:23:11 +01:00
Jocelyn Fiat
a362e7d9c6 Avoid calling ANY.print, prefer io.error.put_string
Fixed obsolete calls.
2012-12-20 18:32:56 +01:00
Jocelyn Fiat
27d2308d6f Added comment to self documentation features 2012-12-20 10:09:26 +01:00
Jocelyn Fiat
aa65c16957 Breaking changes:
added `a_request_methods' argument to WSF_ROUTER_SELF_DOCUMENTATION_HANDLER.mapping_documentation
 added similar argument to WSF_ROUTER_SELF_DOCUMENTATION_ROUTER_MAPPING.documentation
Renamed WSF_ROUTER_METHODS as WSF_REQUEST_METHODS
Enhanced WSF_REQUEST_METHODS with new has_... function
Added WSF_ROUTER_VISITOR and WSF_ROUTER_ITERATOR that may be useful to iterate inside the router.
   we may improve the implementation of the router using those visitors in the future.
Improved the WSF_DEFAULT_RESPONSE to embedded suggested items (typically based on pseudo self documented router)
2012-12-19 16:42:26 +01:00
Jocelyn Fiat
021f0eeaec Updated documentation output 2012-12-19 14:35:47 +01:00
Jocelyn Fiat
cc570f5abf Added WSF_DEFAULT_*_RESPONSE
Fixed the method not allowed by setting the Allow: header
2012-12-14 15:52:35 +01:00
Jocelyn Fiat
6eb0ebd873 Merge pull request #16 from colin-adams/master
Implementation for automatic HEAD and first pass at HTTP 1.1 conformance contracts
2012-12-13 13:58:42 -08:00
Jocelyn Fiat
b7505e67b8 Added to WSF_REQUEST
- raw_header_data: like meta_string_variable
  - read_input_data_into (buf: STRING)
  - is_content_type_accepted (a_content_type: READABLE_STRING_GENERAL): BOOLEAN
Changed raw_input_data to return IMMUTABLE_STRING_8
Added WSF_METHOD_NOT_ALLOWED_RESPONSE
Added WSF_TRACE_RESPONSE to respond TRACE request
Now Not_found response return html content if the client accepts, other text/plain
Implemented TRACE response, and Method not allowed as implementation of WSF_ROUTED_SERVICE.execute_default
2012-12-13 17:29:46 +01:00
Jocelyn Fiat
cb034fc94e Added missing "context" classes for uri and starts_with mapping+handler (and helper classes).
So that it is address more needs.
Factorized code between "context" and non context classes.
2012-12-13 12:01:24 +01:00
Colin Adams
365da7e30a merged from upstream 2012-12-08 08:25:47 +00:00
Jocelyn Fiat
5de14b114e Provide a way to log into a file, rather than just console output
Minor optimization for WSF_LOGGING_FILTER
2012-12-05 22:30:24 +01:00
Olivier Ligot
075ac1d628 Logging filter
The logging filter is now part of EWF core (before it was only available in
the filter example) and can therefore be reused by others needing it.
Note that this is a first implementation. It can certainly be improved in
the future to support more fine grained logging.
2012-12-05 22:30:12 +01:00
Jocelyn Fiat
156406f9ac Fixed various compilation issue with new self documentation
Improved the self documentation handler to provide a make_hidden creation procedure
2012-12-03 12:20:12 +01:00
Jocelyn Fiat
125d44ff67 Added debug clause to detect in WSF_ROUTER.map_with_request_methods the existing conflicts with similar mapping.
Added smart handling of HEAD request.
Exported some internal features of WSF_REQUEST and WSF_RESPONSE to respectively WSF_REQUEST_EXPORTER and WSF_RESPONSE_EXPORTER
2012-11-26 22:58:48 +01:00
Jocelyn Fiat
bdee22f647 added debug_output to WSF_ROUTER_MAPPING 2012-11-26 22:37:44 +01:00
Jocelyn Fiat
8b5353df0a Avoid using INDEXABLE_ITERATION_CURSOR.is_last 2012-11-26 16:06:08 +01:00
Colin Adams
a9d83f97a8 Completed first pass for HTTP 1.1 conformace contracts 2012-11-24 15:45:42 +00:00
Colin Adams
68cd78d87d Forced HEAD when GET requested 2012-11-24 14:13:38 +00:00
Jocelyn Fiat
af07986eec New design for self documented router.
The documentation is built only on demand.
A mapping entry can be hidden for the documentation
One can change the status code when building itself the WSF_ROUTER_SELF_DOCUMENTATION_MESSAGE
2012-11-23 22:49:11 +01:00
Jocelyn Fiat
f817008bcd Do not use {INDEXABLE_ITERATION_CURSOR}.is_last since it is added from EiffelStudio v7.2 2012-11-23 18:04:21 +01:00
Jocelyn Fiat
66ac29b3fc Updated signatures for the self documentated message 2012-11-23 15:59:56 +01:00
Jocelyn Fiat
dcb630ce98 Updated self documentation 2012-11-23 15:52:59 +01:00
Jocelyn Fiat
9fcb897b0b Allow to use WSF_ROUTER_SELF_DOCUMENTATION_MESSAGE without any WSF_ROUTER_SELF_DOCUMENTATION_HANDLER
i.e without any specific URL to this self documentation.
Added custom value such as header, footer, style css url ...
2012-11-23 14:12:13 +01:00
Jocelyn Fiat
52cc743997 Added WSF_ROUTER.has_item_associated_with_resource and item_associated_with_resource
Added WSF_ROUTER_MAPPING.associated_resource
Added WSF_ROUTER_SELF_DOCUMENTATION_HANDLER and WSF_ROUTER_SELF_DOCUMENTATION_MESSAGE to provide a self documentation for WSF_ROUTER (for now, only HTML)
2012-11-23 12:38:49 +01:00
Jocelyn Fiat
ee13393a91 Made WSF_ROUTER_METHODS.new_cursor an INDEXABLE_ITERATION_CURSOR which is richer than just ITERATION_CURSOR 2012-11-23 10:07:33 +01:00
Jocelyn Fiat
59316c9c65 Added WSF_ROUTER_ITEM to replace a structure represented with named TUPLE
Added debug_output to ease debugging
2012-11-20 13:49:40 +01:00
Jocelyn Fiat
2e774f2e10 Added WSF_ROUTING_CONTEXT_HANDLER 2012-10-22 14:27:03 +02:00
Jocelyn Fiat
fb3148aeea Using anchor type to create the router
this is more flexible for eventual descendants redefining the router
2012-10-22 11:15:23 +02:00
Jocelyn Fiat
aa743c0a7d Removed generic parameter in WSF_FILTER_HANDLER, since it is useless and make code heavy
Signed-off-by: Olivier Ligot <oligot@gmail.com>
Signed-off-by: Jocelyn Fiat <jfiat@eiffel.com>
2012-10-08 10:40:44 +02:00
Jocelyn Fiat
016efaed15 Updated Copyright 2012-10-04 15:04:14 +02:00
Jocelyn Fiat
55e4602faf Fixed compilation for STARTS_WITH_ handler 2012-10-04 14:52:28 +02:00
Jocelyn Fiat
2f6a6cbf5f Added notion of mapping factory, so one can implement a handler without having to implement new_mapping
Added filter context handler
Added WSF_STARTS_WITH_ROUTING_HANDLER and WSF_URI_ROUTING_HANDLER (in addition to the uri template version)
2012-10-04 14:31:03 +02:00
Jocelyn Fiat
6619349f7b Fixed some configuration files (ecf)
Fixed various compilation issue
Fixed draft rest library (still experimental and should be removed in the future)
2012-10-01 12:04:17 +02:00
Jocelyn Fiat
291bb3a33b moved wsf_extension inside wsf/extension as wsf/wsf_extension.ecf
added wsf/session as wsf/wsf_session.ecf
In descendants of WSF_HANDLER , we can keep the result of new_mapping as WSF_ROUTER_MAPPING
2012-09-28 14:42:31 +02:00
Jocelyn Fiat
e01c5bec57 Reviewed the semantic of the handler context.
Adapted existing code to fit the new router design.
2012-09-27 15:09:41 +02:00
Jocelyn Fiat
28186efbe7 Applied new ROUTER design to the whole EWF project. 2012-09-25 23:18:17 +02:00
Jocelyn Fiat
0503e63209 Minor implementation changes (feature renaming, ... ) 2012-09-19 10:50:38 +02:00
Jocelyn Fiat
ace897ea2b New ROUTER design, much simpler, less generic, easier to extend, and now one can mix uri map, uri_template map and so on.
Update the "tutorial" example.
2012-09-19 10:50:27 +02:00
Jocelyn Fiat
0665085eee updated to use WSF_STRING.value instead of obsolete WSF_STRING.string 2012-06-29 10:48:21 +02:00
Jocelyn Fiat
23de980e57 added methods_head_get_post and methods_head_get 2012-06-15 10:54:53 +02:00
Jocelyn Fiat
2b730186a2 Fixing issue with HEAD and make_from_iterable 2012-06-14 12:28:52 +02:00
Jocelyn Fiat
8a58d62a7e Adopted convention name and value or values for WSF_VALUE and descendant (WSF_STRING ...)
kept `key' as redirection, and also string as obsolete redirection.
Router: provide a way to pass the request methods without using manifest string, thanks to WSF_ROUTER_METHODS
  so instead of using manifest array or manifest strings, just create an instance of WSF_ROUTER_METHODS
  for convenience, WSF_ROUTER provides a few `methods_...' returning prebuilt WSF_ROUTER_METHODS objects
Improved code related to unicode handling in URL, and parameters (before the framework was doing too much)
2012-06-11 14:58:13 +02:00
Jocelyn Fiat
445a27ddf8 Now inherit create_router ; but it is still possible to redefine it.
Added some wsf_reponse_message for redirection
Use "found" for the redirec_now ...
Added content to the tutorial
2012-05-28 10:54:05 +02:00
Jocelyn Fiat
c3c27c5027 Rather use (READABLE_)STRING_GENERAL for argument instead of _8 or _32 variant
Better design to set the WSF_REQUEST.path_parameters
   especially handle the case where the request goes trought more than one route (could be the case when using WSF_ROUTING_HANDLER)
2012-05-14 18:12:28 +02:00
Jocelyn Fiat
278a71eaaf Reviewed WSF_REQUEST.item (..) and items to look into Form, Query, and Path (cookie are excluded for security)
Added WSF_REQUEST.path_parameter (a_name): detachable WSF_VALUE
   - fill path_parameters using `import_raw_path_parameters"
     when executing the route
   - reset to previous value with reset_path_parameters (..),
     just in case the request is executed via severals routes.
2012-05-07 23:16:52 +02:00
Jocelyn Fiat
face4550f2 Fixed wrong signature should be READABLE_STRING_32 instead of _8 2012-05-02 19:22:39 +02:00
Jocelyn Fiat
07b3eddefe Fixed signature issue, the argument `name' should be READABLE_STRING_32 2012-04-30 15:51:10 +02:00
Jocelyn Fiat
21b03a05fd Added WSF_ROUTER.pre_route_execution_actions: ACTION_SEQUENCE [like route]
This way, one can add logger hook to router, to see which "route" was taken by the request.
2012-04-13 16:40:19 +02:00
Jocelyn Fiat
3bbf356f19 Missing commit related to changes on WSF_ROUTER 2012-04-12 11:59:14 +02:00