Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-4457

FileUploadInterceptor uses injected pattern matcher

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.3.24
    • Core Interceptors
    • None

    Description

      Currently FileUploadInterceptor uses injected pattern matcher for checking allowedTypes, which yields inconsistent behavior with different default pattern matchers. Some mime types which are working fine with WildcardHelper are not working with the RegexPatternMatcher, because of the special regex character presented in them (e.g. image/svg+xml - + is a special character in regex).

      IMO file upload interceptor should use WildcardHelper no matter what pattern matcher is set as the default one. Or is there any point in injecting pattern matcher in file upload interceptor?

      Original report: “Content-Type not allowed” while uploading an SVG file, that is in the allowed whitelist

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            lukaszlenart Lukasz Lenart
            aleksandr-m Aleksandr Mashchenko
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment