{"action":"opened","issue":{"url":"https://api.github.com/repos/NSwag/NSwag/issues/271","repository_url":"https://api.github.com/repos/NSwag/NSwag","labels_url":"https://api.github.com/repos/NSwag/NSwag/issues/271/labels{/name}","comments_url":"https://api.github.com/repos/NSwag/NSwag/issues/271/comments","events_url":"https://api.github.com/repos/NSwag/NSwag/issues/271/events","html_url":"https://github.com/NSwag/NSwag/issues/271","id":175248479,"number":271,"title":"SwaggerMiddleware not invoking correctly on IIS with virtual directory","user":{"login":"DorianGreen","id":1913786,"avatar_url":"https://avatars.githubusercontent.com/u/1913786?v=3","gravatar_id":"","url":"https://api.github.com/users/DorianGreen","html_url":"https://github.com/DorianGreen","followers_url":"https://api.github.com/users/DorianGreen/followers","following_url":"https://api.github.com/users/DorianGreen/following{/other_user}","gists_url":"https://api.github.com/users/DorianGreen/gists{/gist_id}","starred_url":"https://api.github.com/users/DorianGreen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DorianGreen/subscriptions","organizations_url":"https://api.github.com/users/DorianGreen/orgs","repos_url":"https://api.github.com/users/DorianGreen/repos","events_url":"https://api.github.com/users/DorianGreen/events{/privacy}","received_events_url":"https://api.github.com/users/DorianGreen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-09-06T13:35:12Z","updated_at":"2016-09-06T13:35:12Z","closed_at":null,"body":"I am hosting an API with swagger on IIS with a virtual directory. e.g., localhost/virtual.\r\nIn the SwaggerMiddleware, the Uri matching condition is failing due to the OWIN pipeline injecting the entire path with the virtual directory instead of just the relative path.\r\n\r\ncontext.Request.Uri.PathAndQuery returns \"virtual/swagger/v1/swagger.json\"\r\n\r\n`if (context.Request.Uri.PathAndQuery.Trim('/') == this._path.Trim('/'))\r\n      {\r\n        context.Response.StatusCode = 200;\r\n        context.Response.Write(this.GenerateSwagger(context));\r\n      }`\r\n\r\nShould be:\r\n\r\n`if (context.Request.Path.Trim('/') == this._path.Trim('/'))\r\n      {\r\n        context.Response.StatusCode = 200;\r\n        context.Response.Write(this.GenerateSwagger(context));\r\n      }`"}}
{"actor":{"display_login":"DorianGreen"}}