Skip to content

Instantly share code, notes, and snippets.

@snicoll
Created March 7, 2014 10:25
Show Gist options
  • Save snicoll/9409093 to your computer and use it in GitHub Desktop.
Save snicoll/9409093 to your computer and use it in GitHub Desktop.

UrlPathHelper usage in SPR

OK:

  • PathExtensionContentNegotiationStrategy sets the urlDecode to false
  • WebAsyncManager, DispatcherServlet and NoSuchRequestHandlingMethodException use it only for logging purposes (the latter in a weird way)

Candidate:

  • AbstractHandlerMapping
  • AbstractUrlViewController
  • WebContentInterceptor
  • AnnotationMethodHandlerAdapter
  • AbstractUrlMethodNameResolver
  • DefaultRequestToViewNameTranslator

Problematic:

  • PatternsRequestCondition creates an instance internally, no config there
  • ServletCookieValueMethodArgumentResolver decodes a cookie value, potentially according to the request encoding! No usage for the setter so it uses default settings by default. AbstractFlashMapManager and RequestContext are also affected by that exact same issue
  • ServletUriComponentsBuilder might very well take a wrong decision in case of encoding mismatch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment