Skip to content

Commit

Permalink
#181: when unknown fabric, now return 404
Browse files Browse the repository at this point in the history
  • Loading branch information
ypujante committed Dec 6, 2012
1 parent 9011117 commit c9144e5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class UserPreferencesFilters
}

// 2) last resort (when only 1 fabric, simply select it...)
if(!fabric)
if(!fabric && !request.isRestRequest)
{
def fabricNames = fabricService.listFabricNames()
if(fabricNames.size() >= 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import org.linkedin.util.codec.Base64Codec
import org.linkedin.groovy.util.json.JsonUtils
import org.linkedin.util.lang.LangUtils

import javax.servlet.http.HttpServletResponse

/**
* Base class for controllers
*
Expand All @@ -41,7 +43,10 @@ class ControllerBase

if(!fabric)
{
redirect(controller: 'fabric', action: 'select')
if(request.isRestRequest)
response.sendError(HttpServletResponse.SC_NOT_FOUND, "fabric")
else
redirect(controller: 'fabric', action: 'select')
return false
}

Expand Down

0 comments on commit c9144e5

Please sign in to comment.