sergey-su / logjoint

LogJoint log viewer core. Viewer plugins for publicly-available domains.
MIT License
55 stars 13 forks source link

Support Query uri in logjoint protocol handler #6

Closed pnelson786 closed 6 years ago

pnelson786 commented 6 years ago

Logjoint works great with webservice query url like below when passed in the gui dialog box https://brblogs.trafficmanager.net/Logs/DownloadBlob?containerId=5537dc91-1243-4b93-98fd-a53b4c06ce17&path=dummy.blog

But when I put it in logjoint protocol handler like so it does not work

logjoint://?t=log&uri=https://brblogs.trafficmanager.net/Logs/DownloadBlob?containerId=5537dc91-1243-4b93-98fd-a53b4c06ce17&path=dummy.blog

But I really want to improve this , since it helps usability and saves dev time... launch logjoint in a single click.

Debugging it is seems cause we use Http.ParseQueryString. it extracts out "path" . I was thinking we special case it by introducing a new identifier uri_query something like so if (uri.Query.Contains("?uri_query=")){ string contentUri = uri.Query.Split(new string[] { "?uri_query=" }, StringSplitOptions.None)[1]; } else { var args = System.Web.HttpUtility.ParseQueryString(uri.Query);

sergey-su commented 6 years ago

logjoint://?t=log&uri= shoud work without any special casing.

Your URL works ok for me (up until login screen of course). Maybe the behavior depends on browser. To be standard copliant make sure you encodeURIComponent the log URL part. Your URL should be logjoint://?t=log&uri=https%3A%2F%2Fbrblogs.trafficmanager.net%2FLogs%2FDownloadBlob%3FcontainerId%3D5537dc91-1243-4b93-98fd-a53b4c06ce17%26path%3Ddummy.blog.

Another example that works for me and that needs no auth: logjoint://?t=log&uri=https%3A%2F%2Fraw.githubusercontent.com%2Fsergey-su%2Flogjoint%2Fmaster%2Ftrunk%2Fmodel%2Ftests%2FSamples%2FXmlWriterTraceListener1.xml

pnelson786 commented 6 years ago

Thanks a bunch! It works great for the way you suggested when I used the standard complaince url. Haven't tried it, do you know if this protocol handler works on Mac OSX?

sergey-su commented 6 years ago

Yes, logjoint: protocol works on mac os too