Bug 24017 - UriTemplate that lacks var=val pair(s) after ? symbol fails unlike .NET equivalent
Summary: UriTemplate that lacks var=val pair(s) after ? symbol fails unlike .NET equiv...
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: WCF assemblies (show other bugs)
Version: 3.2.x
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-10-23 13:08 UTC by SN
Modified: 2017-09-06 16:55 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report for Bug 24017 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
NEW

Description SN 2014-10-23 13:08:22 UTC
for example in

[WebGet(UriTemplate = "query?", BodyStyle = WebMessageBodyStyle.Bare)]
Stream QueryMethod();

if the URL is http://some.host/query?
then you'll get the stack trace below. But in .NET there is no expectation of var=val pairs after the ? symbol, no exceptions either.
A workaround that might work is to supply a fake var=val pair such as http://some.host/query?var=
assuming that the service doesn't error on it.


---------------- stack trace ---------------
Exception Array index is out of range.   at System.UriTemplate.Match (System.Uri baseAddress, System.Uri candidate) [0x00000] in <filename unknown>:0 
  at System.UriTemplateTable.MatchSingle (System.Uri uri) [0x00000] in <filename unknown>:0 
  at System.ServiceModel.Dispatcher.WebHttpDispatchOperationSelector.SelectOperation (System.ServiceModel.Channels.Message& message, System.Boolean& uriMatched) [0x00000] in <filename unknown>:0 
  at System.ServiceModel.Dispatcher.WebHttpDispatchOperationSelector.SelectOperation (System.ServiceModel.Channels.Message& message) [0x00000] in <filename unknown>:0 
  at System.ServiceModel.Dispatcher.OperationInvokerHandler.GetOperation (System.ServiceModel.Channels.Message input, System.ServiceModel.Dispatcher.DispatchRuntime dispatchRuntime) [0x00000] in <filename unknown>:0 
  at System.ServiceModel.Dispatcher.OperationInvokerHandler.ProcessRequest (System.ServiceModel.Dispatcher.MessageProcessingContext mrc) [0x00000] in <filename unknown>:0 
  at System.ServiceModel.Dispatcher.BaseRequestProcessorHandler.ProcessRequestChain (System.ServiceModel.Dispatcher.MessageProcessingContext mrc) [0x00000] in <filename unknown>:0 
  at System.ServiceModel.Dispatcher.BaseRequestProcessorHandler.ProcessRequestChain (System.ServiceModel.Dispatcher.MessageProcessingContext mrc) [0x00000] in <filename unknown>:0 
  at System.ServiceModel.Dispatcher.HandlersChain.ProcessRequestChain (System.ServiceModel.Dispatcher.MessageProcessingContext mrc) [0x00000] in <filename unknown>:0 
  at System.ServiceModel.Dispatcher.BaseRequestProcessor.ProcessRequest (System.ServiceModel.Dispatcher.MessageProcessingContext mrc) [0x00000] in <filename unknown>:0
Comment 1 jacotb 2015-01-08 17:18:51 UTC
Confirmed.