-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some clients can't connect as 'Route Not Found' due to PatternParser class behavior. #216
Comments
@longlongago-k I'm more curious about why the |
The documentation for the
The difference between the Ergo, the problem you are experiencing has something to do with the fact that the |
@scottoffen Just for the information, I resolved this issue by following ways:
|
Tell me more about this....do you have code I can look at? I can think of a way to fix this, but it's hard to know for sure if I can't test it. |
@longlongago-k do you have a code sample I can look at? |
Hi, a) Normal client requests: My device requests b) style (absolute-form). [RestRoute(HttpMethod = HttpMethod.GET, PathInfo = "/the_endpoint/*.*")]
public IHttpContext Exec(IHttpContext context){
} But, "/the_endpoint/." was converted to "^/the_endpoint/." in Grapevie Routing table. [PatternParser.cs]
//old
//var pattern = new StringBuilder("^");
//modified
var pattern = new StringBuilder(""); // delete ^ char @scottoffen You can simply test by following sample code. async void Main()
{
//Prepare:
// add route with your Grapevine server as [RestRoute(HttpMethod = HttpMethod.GET, PathInfo = "/the_endpoint/*.*")]
var url = @"http://192.168.10.2:8080/the_endpoint";//Set your IP address. do not use localhost string, because Windows ignore proxy
WebRequestHandler handler = new WebRequestHandler();
//Add proxy
handler.Proxy = new WebProxy("http://192.168.10.2:8080"); // do not use localhost, because Windows ignore proxy
using (HttpClient client = new HttpClient(handler))
{
HttpResponseMessage response = client.GetAsync(url).Result;
var str = await response.Content.ReadAsStringAsync();
Console.WriteLine(str);
}
} This usage is very special case, and generally this case should be used with another (Reverse) proxy. |
Excellent, thank you. I'll take a look at this. Edit: Using .NET 5.0 and the |
I found the issue. It was already (unintentionally) fixed in Grapevine 5. I'll port that quick fix over to Grapevine 4 and publish a new version. (Because I don't use |
The fix for this is in release 4.2.2, and has been uploaded to Nuget. |
I'm trying to connect to Grapevine server from two type clients.
The client (2) can't connect due to URL filter in Grapevine RoutingTable.
As far as I investigated HttpRequest for two clients, I found some differences:
Request URL: http://192.168.14.3:8080/the_endpoint
I tried URL search pattern such as following:
But, current behavior of PatternParser used in RoutingTable, always insert ^ at the beginning of URL search pattern.
PathInfoPattern = "the_endpoint/." ---> "^the_endpoint/."
Could you please consider to user can change this adding '^' behavior?
The text was updated successfully, but these errors were encountered: