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)

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


Attachments

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.

Note You need to log in before you can comment on or make changes to this bug.