Skip to content
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

Area routes exposed even when exposeAllRoutes = "false" #18

Closed
jFensch opened this issue Jul 30, 2013 · 7 comments
Closed

Area routes exposed even when exposeAllRoutes = "false" #18

jFensch opened this issue Jul 30, 2013 · 7 comments

Comments

@jFensch
Copy link
Contributor

jFensch commented Jul 30, 2013

I would expect that when is set in web.config that no routes are exposed until I decorate classes with the ExposeRoutesInJavaScript attribute. However, all my area routes appear to be exposed as Router.routes has 9 routes client-side. Is there something I'm missing?

@Daniel15
Copy link
Owner

That's strange, it should definitely be hiding the routes (and I have unit tests around that, although they can probably be improved). Could you please make a simple test case that replicates the issue and attach it here?

@Daniel15
Copy link
Owner

Daniel15 commented Aug 1, 2013

Thanks for your pull request #19. I started working on this today but I realised that there's some other issues. I'm only checking the controller based on its name, so if you have multiple controllers called "HelloWorldController" (say, in two different areas), they will all be exposed.

Additionally there needs to be some additional logic for areas. I think the logic for each area should be:

  • If no controllers in the area are exposed, don't expose any routes at all (including the default route, if present)
  • If at least one controller in the area is exposed, expose the default route (as any controller could be using it)
  • All other logic the same as current (hide routes specific to hidden controllers, expose routes specific to exposed controllers)

What do you think?

@jFensch
Copy link
Contributor Author

jFensch commented Aug 2, 2013

The logic looks valid to me.

On Thu, Aug 1, 2013 at 8:28 AM, Daniel Lo Nigro notifications@github.comwrote:

Thanks for your pull request #19#19.
I started working on this today but I realised that there's some other
issues. I'm only checking the controller based on its name, so if you have
multiple controllers called "HelloWorldController" (say, in two different
areas), they will all be exposed.

Additionally there needs to be some additional logic for areas. I think
the logic for areas should be:

  • If no controllers in the area are exposed, don't expose any routes
    at all (including the default route, if present)
  • If at least one controller is exposed, expose the default route (as
    any controller could be using it)
  • All other logic the same as current (hide routes specific to hidden
    controllers, expose routes specific to exposed controllers)

What do you think?


Reply to this email directly or view it on GitHubhttps://github.com//issues/18#issuecomment-21932746
.

@Daniel15
Copy link
Owner

Daniel15 commented Aug 4, 2013

Thanks, this should be fixed now. Could you please try getting the latest version off the build server and see if it works as expected? Here's the direct .nupkg link: http://teamcity.codebetter.com/repository/download/bt1035/81883:id/RouteJs.Mvc4.1.2.0-dev.nupkg

@jFensch
Copy link
Contributor Author

jFensch commented Aug 4, 2013

This seems to resolve the issue for me. Thanks.

On Sun, Aug 4, 2013 at 9:12 AM, Daniel Lo Nigro notifications@github.comwrote:

Thanks, this should be fixed now. Could you please try getting the latest
version off the build server and see if it works as expected? Here's the
direct .nupkg link:
http://teamcity.codebetter.com/repository/download/bt1035/81883:id/RouteJs.Mvc4.1.2.0-dev.nupkg


Reply to this email directly or view it on GitHubhttps://github.com//issues/18#issuecomment-22071482
.

@jFensch
Copy link
Contributor Author

jFensch commented Aug 5, 2013

When do you expect to push the changes up to NuGet?

On Sun, Aug 4, 2013 at 4:01 PM, Jeremy Fensch jfensch@gmail.com wrote:

This seems to resolve the issue for me. Thanks.

On Sun, Aug 4, 2013 at 9:12 AM, Daniel Lo Nigro notifications@github.comwrote:

Thanks, this should be fixed now. Could you please try getting the latest
version off the build server and see if it works as expected? Here's the
direct .nupkg link:
http://teamcity.codebetter.com/repository/download/bt1035/81883:id/RouteJs.Mvc4.1.2.0-dev.nupkg


Reply to this email directly or view it on GitHubhttps://github.com//issues/18#issuecomment-22071482
.

@Daniel15
Copy link
Owner

Daniel15 commented Aug 6, 2013

I just pushed these changes to NuGet now so if you update your packages you should see them :)

@Daniel15 Daniel15 closed this as completed Aug 6, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants