fix: correct handling of HttpServletRequest#getHeaders and tests
This pull request addresses issue #6.
Properly handles cases where container may return blank String values in the returned list. Tests were previously adding List objects as headers - need to add just String values.
See the javadocs for HttpServletRequest#getHeaders for reference.
I intend to release 1.6.1 when this is merged.
Edit: this also corrects the case of the name of the Manifest isMemberOf
header.
Merge request reports
Activity
Build finished. Tests FAILED. Build results available at: https://ia-builds.doit.wisc.edu:8443/job/uw-spring-security-master-pull-requests/89/
Added 1 commit:
- 31804c0e - fix: filter test needs to use correct case for 'isMemberOf'
Build finished. Tests PASSED. Build results available at: https://ia-builds.doit.wisc.edu:8443/job/uw-spring-security-master-pull-requests/90/
Added 1 commit:
- 460235a6 - fix: case of default value for 'preauth.manifestHeader' property
Build finished. Tests PASSED. Build results available at: https://ia-builds.doit.wisc.edu:8443/job/uw-spring-security-master-pull-requests/91/
115 * This method provides a safe way to get the values for the specified header as a non-null 116 * (but still potentially empty) {@link List}. 117 * 118 * @see HttpServletRequest#getHeaders(String) 119 * @see StringUtils#isNotBlank(CharSequence) 120 * @param request the HTTP request 121 * @param headerName the name of the multi-valued header 122 * @return a never null, but potentially empty, {@link List} of not blank values for the requested header 123 */ 124 protected List<String> safeGetHeaders(HttpServletRequest request, String headerName) { 125 Enumeration<String> enumeration = request.getHeaders(headerName); 126 if(enumeration == null) { 127 return Collections.emptyList(); 128 } 129 List<String> result = new ArrayList<>(); 130 for(String next : Collections.list(enumeration)){ mentioned in commit fcd9cfd1