Changeset 34479


Ignore:
Timestamp:
2020-10-19T16:08:30+13:00 (4 years ago)
Author:
davidb
Message:

Change made after testing with Greenstone3 install on atea.space, where it operates proxied through Apache2 https; problem encountered was that the redirect_url would be set to http://localhost:8383/greenstone3/library when looking to access a restricted document in a collection. This change brings the two places that call generateLoginPage() manipulate the requestURL/URI the same way

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/LibraryServlet.java

    r34217 r34479  
    10021002        {
    10031003            //The user entered in either the wrong username or the wrong password
    1004             String redirect_url_string = library_name;
    1005             if (request.getQueryString() != null) //  && request.getQueryString().length() > 0)
     1004       
     1005            HttpSession session = request.getSession();
     1006            ServletContext context = session.getServletContext();
     1007            String redirect_url_string = request.getRequestURI().replaceFirst(context.getContextPath() + "/", "");
     1008
     1009            if ((request.getQueryString() != null) && (request.getQueryString().length() > 0))
    10061010            {
    10071011            redirect_url_string += "?" + request.getQueryString().replace("&", "&");
     
    11071111            error_message = getTextString("auth.error.incorrect_login", lang);
    11081112        }
    1109         String redirect_url_string = request.getRequestURL().toString();
     1113       
     1114        HttpSession session = request.getSession();
     1115        ServletContext context = session.getServletContext();
     1116        String redirect_url_string = request.getRequestURI().replaceFirst(context.getContextPath() + "/", "");
     1117
    11101118        if (request.getQueryString() != null && request.getQueryString().length() > 0)
    11111119        {
    11121120            redirect_url_string += "?" + request.getQueryString().replace("&", "&");
    11131121        }
    1114        
     1122
    11151123        generateLoginPage(redirect_url_string, error_message, userContext, out, baseURL, output);
    11161124        return false;
Note: See TracChangeset for help on using the changeset viewer.