Announcement Announcement Module
Collapse
No announcement yet.
QueryString parameters not honored when redirecting Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • QueryString parameters not honored when redirecting

    When a redirect to switch domains is made, querystring parameters are not preserved.

    Here's my scenario:
    My application is connected to FB for user login/registration. Because of how the spring-social bean is configured, out of the box I only have one return_uri for both mobile and desktop; this means that when my app gets called back the interceptor handler kicks in and redirects to the correct site, the thing is that the code parameter is not added to the URL and thus I can't authenticate.

    I think this could be solved easily by modifying AbstractSiteUrlFactory.createSiteUrlInternal() like this:

    Code:
    	protected String createSiteUrlInternal(HttpServletRequest request, String serverName, String path) {
    		StringBuilder builder = new StringBuilder();
    		builder.append(request.getScheme()).append("://").append(serverName);
    		String optionalPort = optionalPort(request);
    		if (optionalPort != null) {
    			builder.append(optionalPort);
    		}
    		builder.append(path);
    		String queryString = request.getQueryString();
    		if( queryString != null ){
    			builder.append("?" + queryString);
    		}
    		return builder.toString();
    	}
    (Potentially we need to first unescape the querystring, as it is re-escaped afterwards in the calling method?)

    The thing is that it's really tricky to fix because I have to subclass several classes (the ones for Tablet, Mobile, "Normal") (or just put a new one first into the classpath).

    Thanks
    ab

  • #2
    I've created a JIRA for this to investigate the issue. Thanks!

    Comment


    • #3
      I've pushed a fix for MOBILE-69 which should resolve this issue. Thanks!

      Comment

      Working...
      X