Commit Graph
52 Commits
Author SHA1 Message Date
Bassam Tabbara f012d0b344 Fixed regression in System.Web.Routing caused by 62b047a. Value and constraint where switched when evaluating regex route constraints. 2011-08-07 23:18:18 -07:00
Bassam Tabbara 95525291bf [asp.net] Fix for bug #667513. Implement support for PathInfo in Route.GetRouteData 2011-03-16 01:10:55 +01:00
Marek Safar 2ba6a8925b Fixed few unit tests build issues 2011-03-08 14:10:16 +00:00
Marek Habersack 62b047ae5b [asp.net] Fix for bug #671753. Route.GetVirtualPath must take ambient values into account. 2011-02-25 13:06:51 +01:00
Miguel de Icaza 38253abf8c Add solution files 2011-02-12 22:09:49 -05:00
Marek Habersack d66b7f5543 [asp.net,routing] Fix for bug #651966. Regular expression constraints must be treated as absolute regexps. 2011-01-22 12:43:14 +01:00
Marek Habersack d3a5fe689a [asp.net] Make StopRoutingHandler actually stop the routing instead of throwing an exception
Patch from Damir Simunic <[email protected]>, thanks!
2011-01-14 21:30:11 +01:00
Marek Habersack 69461167e7 [asp.net,routing] Fix for bug #651593. Don't match all-literal routes for URLs with excessive segments. 2010-11-05 11:36:49 +01:00
Marek Habersack 967d70e50b [asp.net,routing] Fix for bug #648901. Matching engine must ignore trailing slash in the URLs. 2010-10-26 02:00:21 +02:00
Marek Habersack 96b54e28f0 2010-06-05 Marek Habersack <[email protected]>
* PageRouteHandler.cs: implemented

2010-06-05  Marek Habersack  <[email protected]>

	* UrlRoutingModule.cs: 4.0 doesn't do the UrlRouting.axd magic, it
	simply remaps the current handler to the one obtained from the
	route.

2010-06-05  Marek Habersack  <[email protected]>

	* TemplateControlCompiler.cs: expression evaluation results are
	wrapped in a Convert.ConvertTo* call or a typecast.

	* RouteValueExpressionBuilder.cs: implemented

	* RouteUrlExpressionBuilder.cs: added missing custom attributes

svn path=/trunk/mcs/; revision=158497
2010-06-04 22:47:30 +00:00
Marek Habersack 4bcb71eec8 WIP: page routing
svn path=/trunk/mcs/; revision=158496
2010-06-04 22:47:15 +00:00
Marek Habersack 7d005d6a34 2010-05-06 Marek Habersack <[email protected]>
* HttpResponse.cs: implemented the following 4.0 methods:
	RedirectPermanent, RedirectToRoute, RedirectToRoutePermanent and
	RemoveOutputCacheItem.

2010-05-06  Marek Habersack  <[email protected]>

	* RouteCollection.cs: GetVirtualPath throws ArgumentException
	when named route is not found in the collection.

2010-05-06  Marek Habersack  <[email protected]>

	* OutputCacheModule.cs: added a 2.0 internal property to return
	the internal provider used in this profile.

	* OutputCache.cs: added internal RemoveFromProvider method to
	remove items from the indicated provider.

svn path=/trunk/mcs/; revision=156933
2010-05-07 23:02:46 +00:00
Marek Habersack 549b54027c 2010-05-05 Marek Habersack <[email protected]>
* UrlRoutingModule.cs: PostMapRequestHandler is obsolete in 4.0

svn path=/trunk/mcs/; revision=156696
2010-05-05 01:04:39 +00:00
Marek Habersack cb4836ed8f 2010-05-05 Marek Habersack <[email protected]>
* RouteValueDictionary.cs: do not process type fields in
	RouteValueDictionary (object)

	* RouteCollection.cs: GetRouteData throws an exception if Request
	is null in the passed context.
	Added Ignore* and MapPageRoute* 4.0 APIs

	* RequestContext.cs: 4.0 API update

	* PatternParser.cs: match parser rewrite to encompass 4.0 bug
	fixes. We don't emulate some of the pre-4.0 routing bugs anymore.

svn path=/trunk/mcs/; revision=156695
2010-05-05 00:43:57 +00:00
Marek Habersack 43813f347e Fixed a typo
svn path=/trunk/mcs/; revision=151613
2010-02-12 13:46:16 +00:00
Marek Habersack ee4231b4c1 2010-02-12 Marek Habersack <[email protected]>
* AssemblyTargetedPatchBandAttribute.cs: added

2010-02-12  Marek Habersack  <[email protected]>

	* AssemblyInfo.cs: added 4.0 attributes

svn path=/trunk/mcs/; revision=151583
2010-02-12 01:55:29 +00:00
Marek Habersack e5ce3fc558 2009-11-23 Marek Habersack <[email protected]>
* HttpRequest.cs: PathInfo returns an empty string when worker
	request is absent or its GetPathInfo method returns a null. Patch
	from Tiaan <[email protected]>, thanks!

2009-11-23  Marek Habersack  <[email protected]>

	* Route.cs: GetRouteData throws NotImplementedException only when
	pathInfo for the current request is a non-empty string. Patch from
	Tiaan <[email protected]>, thanks!

svn path=/trunk/mcs/; revision=146732
2009-11-23 16:24:04 +00:00
Marek Habersack 193779c1f6 2009-11-09 Marek Habersack <[email protected]>
* RouteCollection.cs: GetVirtualPath doesn't append trailing slash
	to application path blindly anymore. Fixes bug #553022

svn path=/trunk/mcs/; revision=145740
2009-11-09 14:21:09 +00:00
Marek Habersack aa7314ad76 2009-09-09 Marek Habersack <[email protected]>
* RouteTest.cs: added two tests for empty and null route URLs (bug
	#537751)

2009-09-09  Marek Habersack  <[email protected]>

	* Route.cs: when Url is set to null, create a parser for empty
	string. Fixes bug #537751

	* PatternParser.cs: Parse allows for null/empty URLs. Fixes bug
	#537751

svn path=/trunk/mcs/; revision=141630
2009-09-09 19:49:50 +00:00
Marek Habersack 93d477f370 2009-09-08 Marek Habersack <[email protected]>
* UrlRoutingModule.cs: store original request path in
	PostResolveRequestCache and restore it in
	PostMapRequestHandler. Fixes bug #537089

svn path=/trunk/mcs/; revision=141471
2009-09-07 22:22:18 +00:00
Marek Habersack a8cfd91279 2009-08-19 Marek Habersack <[email protected]>
* Route.cs: GetRouteData adds contents of its DataTokens
	dictionary to the returned RouteData.DataTokens dictionary. Fixes
	bug #523330. Patch from [email protected], thanks!

svn path=/trunk/mcs/; revision=140273
2009-08-19 18:37:10 +00:00
Marek Habersack adba453b57 2009-06-25 Marek Habersack <[email protected]>
* RouteCollectionTest.cs, RouteTest.cs: added new tests for
	GetVirtualPath

2009-06-25  Marek Habersack  <[email protected]>

	* PatternParser.cs: parameter name lookups must be
	case-insensitive.
	Null and empty (string) parameters are skipped when building query
	part of the action path.

2009-06-25  Marek Habersack  <[email protected]>

	* LinqDataSource.cs: make ContextType not throw an exception when
	ContextTypeName is not set, but rather return a null in that
	case.

2009-06-25  Marek Habersack  <[email protected]>

	* MetaTableTest.cs: new GetVirtualPath tests.

	* DynamicDataRouteTest.cs: added tests for route.Defaults
	modifications on class init.

	* DynamicDataRouteHandlerTest.cs: added

2009-06-25  Marek Habersack  <[email protected]>

	* MetaTable.cs: Fixes to make tests succeed.

	* MetaModel.cs: added the GetDataFieldAttributes method for
	retrieving attributes associated with data type/field.
	Fixes to make tests succeed.

	* MetaColumn.cs: refactoring - use
	MetaModel.GetDataFieldAttributes instead of the local version.

	* DynamicDataRouteHandler.cs: implemented GetRequestContext,
	GetRequestMetaTable.

	* DynamicDataRoute.cs: when the Action and Table properties are
	set before one of GetVirtualPath or GetRouteData methods are
	called for the first time, a check is made whether the Defaults
	collection exists and whether it contains entries for Action and
	Table. Initialization code makes sure those entries are inserted
	into the dictionary in those cases.

svn path=/trunk/mcs/; revision=136875
2009-06-25 19:35:20 +00:00
Marek Habersack 9743d97ec8 2009-06-16 Marek Habersack <[email protected]>
* RouteValueDictionaryExtensions.cs: do not compile if
	SYSTEMCORE_DEP is not defined

	* PatternParser.cs: if SYSTEMCORE_DEP is not defined, do not
	compile parts which require RouteValueDictionaryExtensions.

2009-06-16  Marek Habersack  <[email protected]>

	* Makefile (LIB_MCS_FLAGS): define SYSTEMCORE_DEP

2009-06-16  Marek Habersack  <[email protected]>

	* DynamicDataManager.cs, DynamicDataExtensions.cs: use new
	DataBoundControl.DataSourceObject instead of
	InternalGetDataSource

2009-06-16  Marek Habersack  <[email protected]>

	* Makefile: warn if the 4.0 assembly is compiled without
	System.Core

svn path=/trunk/mcs/; revision=136222
2009-06-16 13:48:30 +00:00
Marek Habersack c3de939907 2009-06-16 Marek Habersack <[email protected]>
* net_4_0_System.Web.Routing.dll.sources: added. In the 4.0
	profile all classes are compiled into System.Web,
	System.Web.Routing becomes an empty assembly.

2009-06-16  Marek Habersack  <[email protected]>

	* net_4_0_System.Web.Abstractions.dll.sources: added. In the 4.0
	profile all classes are compiled into System.Web,
	System.Web.Abstractions becomes an empty assembly.

2009-06-16  Marek Habersack  <[email protected]>

	* Decorated all classes with the TypeForwardedFrom attribute for
	the 4.0 profile.

2009-06-16  Marek Habersack  <[email protected]>

	* Decorated all classes with the TypeForwardedFrom attribute for
	the 4.0 profile.

2009-06-16  Marek Habersack  <[email protected]>

	* net_4_0_System.Web.dll.sources: added. System.Web.Routing and
	System.Web.Abstractions are part of System.Web.dll in the 4.0
	profile.

svn path=/trunk/mcs/; revision=136182
2009-06-15 23:57:37 +00:00
Marek Safar 6f1d5e5874 More work on 4.0 profile
svn path=/trunk/mcs/; revision=135454
2009-06-04 16:56:17 +00:00
Marek Habersack fed07c12c0 2009-06-04 Marek Habersack <[email protected]>
* RouteValueDictionaryExtensions.cs: if both values are strings in
	Has (string, value), compare them case-insensitively. Fixes bug
	#502555

2009-06-04  Marek Habersack  <[email protected]>

	* RouteCollectionTest.cs: added two more test cases to the bug
	#502555 test. They check whether url generation matches defaults
	case-insensitively.

svn path=/trunk/mcs/; revision=135438
2009-06-04 15:31:02 +00:00
Marek Habersack 9de8e1df99 2009-05-27 Marek Habersack <[email protected]>
* Makefile (LIB_MCS_FLAGS): added support for defining the DEBUG
	symbol on compiler command line.

2009-05-27  Marek Habersack  <[email protected]>

	* PatternParser.cs: if Match is passed an empty path, do not
	attempt to match the Url segments, skip to defaults matching right
	away.

2009-05-27  Marek Habersack  <[email protected]>

	* RouteCollectionTest.cs: added a test for routes from
	NerdDinner.

svn path=/trunk/mcs/; revision=134877
2009-05-27 20:53:58 +00:00
Marek Habersack e0f0a9dd5c 2009-05-25 Marek Habersack <[email protected]>
* UrlPattern.cs: removed - replaced by PatternParser below.

	* RouteValueDictionaryExtensions.cs: added - some shortcuts for
	using RouteValueDictionary in PatternParser

	* Route.cs: use the new PatternParser.
	Factored out ProcessConstraint into ProcessConstraintInternal so
	that the latter can be used by the PatternParser class.
	Added parameter checks in ProcessConstraint.

	* PatternTokenType.cs: added

	* PatternToken.cs: added a helper class for the pattern parser.

	* PatternParser.cs: added. New implementation of url
	parser/matcher/generator which fixes all URL isues known so
	far. Fixes bug #504378

2009-05-25  Marek Habersack  <[email protected]>

	* System.Web.Routing_test.dll.sources: added
	System.Web.Routing/AssertExtensions.cs

	* System.Web.Routing.dll.sources: added
	System.Web.Routing/PatternParser.cs
	System.Web.Routing/PatternToken.cs
	System.Web.Routing/PatternTokenType.cs
	System.Web.Routing/RouteValueDictionaryExtensions.cs

	removed
	System.Web.Routing/UrlPattern.cs

2009-05-25  Marek Habersack  <[email protected]>

	* RouteTest.cs: added several tests for GetVirtualPath,
	GetRouteData, ProcessConstraint and refactored some tests.

	* RouteCollectionTest.cs: added several tests for GetVirtualPath

	* AssertExtensions.cs: added some methods to make code testing for
	exception throws look nicer.

svn path=/trunk/mcs/; revision=134682
2009-05-25 12:38:37 +00:00
Gonzalo Paniagua Javier 7c75a2608c revert. more things broken than fixed
svn path=/trunk/mcs/; revision=134365
2009-05-19 03:03:06 +00:00
Gonzalo Paniagua Javier ede354f48e 2009-05-16 Gonzalo Paniagua Javier <[email protected]>
* RouteCollection.cs: when there is no named route, try the current
	route before going through the list. The known values (default or
	not) for the current route are merged with the values provided when
	attempting to match.
	Example:
		Html.RouteLink ("Text", new { page = 5 });
	
	when the current path is /some/path-here and the route is:

		routes.MapRoute("RouteName", "some/{one}-{two}/{page}",
		new { controller = "Some", action = "Index", page = 1});


svn path=/trunk/mcs/; revision=134272
2009-05-16 09:41:01 +00:00
Gonzalo Paniagua Javier 3ca2cb0516 fix test
svn path=/trunk/mcs/; revision=134029
2009-05-13 00:43:10 +00:00
Gonzalo Paniagua Javier d073acc2b4 2009-05-12 Gonzalo Paniagua Javier <[email protected]>
* UrlPattern.cs: if the pattern is line {a}/{b} and {b} is substituted
	by an empty string, remove the '/' too.


svn path=/trunk/mcs/; revision=134028
2009-05-13 00:40:51 +00:00
Gonzalo Paniagua Javier f9394727d6 2009-05-12 Gonzalo Paniagua Javier <[email protected]>
* UrlPattern.cs: non-string default arguments work now.


svn path=/trunk/mcs/; revision=134012
2009-05-12 23:17:03 +00:00
Marek Habersack d219fb0b28 2009-05-12 Marek Habersack <[email protected]>
* UrlPattern.cs: The
	value comparison is done case-insensitively when the dictionary
	values are strings. Fixes bug #502555

svn path=/trunk/mcs/; revision=133997
2009-05-12 21:51:01 +00:00
Marek Habersack f1f5d2d327 2009-05-12 Marek Habersack <[email protected]>
* UrlPattern.cs: TrySubstitute performs substitution trimming. If
	a segment would be set to a default value and all of its following
	segments as well, it will be omitted from the generated URL.

svn path=/trunk/mcs/; revision=133990
2009-05-12 20:37:34 +00:00
Marek Habersack 93e9f216e1 2009-05-11 Marek Habersack <[email protected]>
* UrlPattern.cs: TrySubstitute treats defaults differently
	now. They are not consulted when checking if the passed values
	match the pattern, but only when substituting the values. Fixes
	bug #502555

2009-05-11  Marek Habersack  <[email protected]>

	* RouteCollectionTest.cs: added test for bug #502555

svn path=/trunk/mcs/; revision=133904
2009-05-11 17:12:11 +00:00
Marek Habersack c9c7252804 2009-05-05 Marek Habersack <[email protected]>
* UrlPattern.cs: Match adds defaults values should some keys be
	missing from the url. Fixes bug #500739

	* Route.cs: a small GetRouteData loop optimization

2009-05-05  Marek Habersack  <[email protected]>

	* RouteTest.cs: added test for bug #500739

svn path=/trunk/mcs/; revision=133577
2009-05-05 13:17:30 +00:00
Marek Habersack 9755b3bd9a 2009-02-18 Marek Habersack <[email protected]>
* UrlPattern.cs:
	Do not use the tokens array in Match.

svn path=/trunk/mcs/; revision=127334
2009-02-18 22:01:22 +00:00
Marek Habersack 56dd281254 2009-02-18 Marek Habersack <[email protected]>
* UrlPattern.cs: TrySubstitute now gets the collection of default
	values and uses it to replace url segments instead of failing when
	the passed values collection is missing a segment.

	* RouteCollection.cs: check if name is null or empty, not just
	null in GetVirtualPath

	* Route.cs: url.TrySubstitute should be passed the defaults
	collection when called from GetVirtualPath

svn path=/trunk/mcs/; revision=127259
2009-02-18 10:26:11 +00:00
Marek Habersack e2d52d7929 2009-02-14 Marek Habersack <[email protected]>
* UrlPattern.cs: use the defaults collection when matching a path
	and segments are missing.

	* RouteCollection.cs: GetRouteData must use VirtualPathProvider
	to check for virtual path existence.

svn path=/trunk/mcs/; revision=126891
2009-02-13 23:21:33 +00:00
Atsushi Eno b0ebd6f5bb 2008-10-23 Atsushi Enomoto <[email protected]>
* UrlPattern.cs : fixed possible out-of-range case ("tableName/" in
	  DynamicData).

	* RouteTest.cs :
	  add one more case that used to cause out-of-range error.


svn path=/trunk/mcs/; revision=116843
2008-10-23 11:03:04 +00:00
Atsushi Eno ac7f00d699 2008-10-17 Atsushi Enomoto <[email protected]>
* RouteValueDictionary.cs : its string comparison is case
	  insensitive.

	* RouteValueDictionaryTest.cs : test for case-insensitive comparison.


svn path=/trunk/mcs/; revision=116277
2008-10-17 18:21:36 +00:00
Atsushi Eno fac89a5692 2008-10-17 Atsushi Enomoto <[email protected]>
* UrlPattern.cs : fixed pattern match for such string that has
	  suffix. (DynamicData uses it.)

	* RouteTest.cs : added test for DynamicData default pattern.


svn path=/trunk/mcs/; revision=116234
2008-10-17 14:59:28 +00:00
Atsushi Eno 95398f45bf 2008-10-16 Atsushi Enomoto <[email protected]>
* System.Web.Routing_test.dll.sources:
	  added RouteValueDictionaryTest.cs.

	* RouteValueDictionary.cs : object argument is actually for
	  anonymous type instance.

	* RouteValueDictionaryTest.cs : new test.


svn path=/trunk/mcs/; revision=116002
2008-10-16 14:20:23 +00:00
Atsushi Eno 8cb21562bb 2008-10-10 Atsushi Enomoto <[email protected]>
* UrlRoutingModule.cs : implement PostMapRequestHandler() and 
	  PostResolveRequestCache() to work correctly in order.
	  Now it should practically work.

	* UrlRoutingModuleTest.cs , TestStubTypes.cs : added test for
	  pipeline processing of requests.


svn path=/trunk/mcs/; revision=115424
2008-10-10 11:34:01 +00:00
Atsushi Eno acfe2986ae RouteCollection.RouteExistingFiles support.
svn path=/trunk/mcs/; revision=113452
2008-09-18 18:35:32 +00:00
Atsushi Eno 38321ee8e6 check invalid constraint and implement ProcessRequest().
svn path=/trunk/mcs/; revision=113386
2008-09-18 04:29:23 +00:00
Atsushi Eno 64a00cfead ongoing UrlRoutingModule implementation and tests.
svn path=/trunk/mcs/; revision=113265
2008-09-17 09:37:25 +00:00
Atsushi Eno 8acac8067d Route.GetRouteData() and HttpMethodConstraint.Match() with tests.
svn path=/trunk/mcs/; revision=112896
2008-09-12 18:02:55 +00:00
Atsushi Eno 1c1ab5802c Url parser implementation and some tests.
svn path=/trunk/mcs/; revision=112830
2008-09-12 09:37:37 +00:00