1. 22 3月, 2019 1 次提交
  2. 09 2月, 2019 1 次提交
  3. 27 11月, 2018 2 次提交
    • R
      Polish · 3eee118b
      Rossen Stoyanchev 提交于
      3eee118b
    • O
      Sanitize request fragment in ResourceUrlEncodingFilter · 959cf616
      Ondrej Kraus 提交于
      Prior to this change, ResourceUrlEncodingFilter would try to resolve
      the resource path using request URL without removing fragment first,
      whereas only paths should be used.
      
      This commit synchronizes behavior of ResourceUrlEncodingFilter with
      behavior of ResourceUrlProvider.
      
      Issue: SPR-17535
      959cf616
  4. 25 10月, 2018 2 次提交
    • B
      Fix absolute paths when transforming resources · 2146e137
      Brian Clozel 提交于
      Prior to this commit, `ResourceTransformerSupport.toAbsolutePath`
      would call `StringUtils.applyRelativePath` in all cases. But this
      implementation is prepending the given path even if the relative path
      starts with `"/"`.
      
      This commit skips the entire operation if the given path is absolute,
      i.e. it starts with `"/"`.
      
      Issue: SPR-17432
      2146e137
    • B
      Fix ResourceUrlEncodingFilter lifecycle · 50a47691
      Brian Clozel 提交于
      Prior to this commit, the `ResourceUrlEncodingFilter` would wrap the
      response and keep a reference to the request. When
      `HttpServletResponse.encodeURL` is later called during view rendering,
      the filter looks at the request and extracts context mapping information
      in order to resolve resource paths in views.
      
      This approach is flawed, when the filter is used with JSPs - if the
      request is forwarded to the container by the `InternalResourceView`,
      the request information is overwritten by the container. When the view
      is being rendered, the information available in the request is outdated
      and does not allow to correctly compute that context mapping
      information.
      
      This commit ensures that that information is being extracted from the
      request as soon as the `ResourceUrlProvider` is set as a request
      attribute.
      
      Issue: SPR-17421
      50a47691
  5. 05 6月, 2018 1 次提交
  6. 30 5月, 2018 1 次提交
  7. 23 5月, 2018 3 次提交
  8. 04 4月, 2018 1 次提交
  9. 20 3月, 2018 1 次提交
  10. 05 3月, 2018 1 次提交
  11. 11 1月, 2018 1 次提交
  12. 15 11月, 2017 1 次提交
  13. 10 11月, 2017 1 次提交
  14. 06 11月, 2017 1 次提交
  15. 21 10月, 2017 1 次提交
  16. 17 7月, 2017 1 次提交
  17. 03 7月, 2017 1 次提交
  18. 24 3月, 2017 1 次提交
    • B
      VersionResourceResolver should delegate to the chain · fdd50315
      Brian Clozel 提交于
      Prior to this commit, the `VersionResourceResolver` implementations of
      `resolveUrlPathInternal` would delegate to the resolver chain but would
      never use the give result if the current request didn't match a
      configured version strategy pattern.
      
      This is a problem if the resolver supposed to resolve the resource path
      is configured after a `VersionResourceResolver` in the resolver chain;
      this means that other resolver never gets to participate in the result
      of the chain.
      
      Issue: SPR-15372
      fdd50315
  19. 21 3月, 2017 1 次提交
    • A
      Update MockServletContext to MediaTypeFactory · d4147184
      Arjen Poutsma 提交于
      This commit changes the `MockServletContext.getMimeType` method to use
      `MediaTypeFactory` instead of JAF. It also adds a `addMimeType(String,
      MediaType)` method to customize the mime types returned from said
      method.
      
      Issue: SPR-14908
      d4147184
  20. 07 1月, 2017 1 次提交
  21. 12 12月, 2016 1 次提交
    • B
      Do not include URL hash in resource paths · 933f1501
      Brian Clozel 提交于
      When getting the lookup path of a resource, both query params and hashes
      should be removed from the request path.
      
      This commit fixes the public path resolution for paths like
      `/resources/main.svg#icon-hamburgermenu`.
      
      Issue: SPR-14928
      933f1501
  22. 24 11月, 2016 1 次提交
    • B
      Do not execute ResourceUrlEncodingFilter only once per request · b10045dc
      Brian Clozel 提交于
      In case the filter is also registered to the ERROR dispatcher, the
      following happens:
      * the filter is executed once for the regular execution
      * the filter should be executed a second time when dispatched to error
      
      Since the filter is a `OncePerRequestFilter`, the filter is only
      executed once and won't be executed when handling the error.
      
      This can lead to situations like spring-projects/spring-boot#7348
      
      This commit makes this filter a simple `GenericFilterBean`.
      
      Issue: SPR-14891
      b10045dc
  23. 16 11月, 2016 1 次提交
    • B
      Prevent resource transformation of gzipped CSS files · cb44f274
      Brian Clozel 提交于
      When resolved through the `GzipResourceResolver`, CSS files can be
      resolved as their pre-gzipped variant, if a ".gz" file is present in the
      configured resource locations.
      
      Such resources are gzipped and thus should not be transformed by
      `CssLinkResourceTransformer`s, since rewriting those would need to
      uncompress/transform/recompress. This would lead to poorer performances
      than resolving plain resources and delegating compression to the
      container.
      
      This commit checks for `GzippedResource` instances in
      `CssLinkResourceTransformer` and avoids processing them.
      
      Issue: SPR-14773
      cb44f274
  24. 28 10月, 2016 1 次提交
  25. 11 10月, 2016 1 次提交
    • B
      Resolve absolute resource links in ResourceTransformers · 679b661e
      Brian Clozel 提交于
      Prior to this commit, `ResourceTransformer` implementations would
      resolve internal links to other resources: both relative and absolute
      request paths.
      For relative request paths, those transformers would call
      `ResourceTransformerSupport.resolveUrlPath` with the resource path,
      as provided in the original file. This can cause problems when a
      `CachingResourceResolver` is configured in the resolver chain, because
      this resolver is caching resources, deriving the cache key from the
      given resource path — this can cause collisions for cases like this:
      
          resources/
          |--foo/
          |  |--foo.css (imports style.css)
          |  |--style.css
          |--bar/
          |  |--bar.css (imports style.css)
          |  |--style.css
      
      The first "style.css" resolved resource is then cached and will be given
      to any request asking for "style.css".
      
      To avoid those issues, this commit improves the `ResourceTransformer`
      implementations to calculate the absolute request path before asking the
      chain to resolve the resource URL, thus avoiding duplications.
      The resource chain will be then asked to resolve "/foo/style/css" or
      "/bar/style.css".
      
      Issue: SPR-14597
      679b661e
  26. 10 9月, 2016 2 次提交
    • B
      Change default appcache manifest file extension · 1881aa5b
      Brian Clozel 提交于
      This commit changes the default file extension configured with
      `AppCacheManifestTranformer`. This ResourceTransformer was previously
      considering `.manifest` files by default, but this has been changed in
      the official spec to `appcache`, in order not to clash with Microsoft's
      unregistered application/manifest type.
      
      Issue: SPR-14687
      1881aa5b
    • B
      Rename ResolvedResource to HttpResource · 4588b6c9
      Brian Clozel 提交于
      `ResolvedResource` is a rather generic name - changing the extended
      interface to something more meaningful: `HttpResource`.
      For now, implementations are linked with the resource handling chain,
      but this aspect has been removed from the interface documentation.
      
      Issue: SPR-14264
      4588b6c9
  27. 07 9月, 2016 1 次提交
    • B
      Add ResolvedResource in resource handling chain · ccb3c44d
      Brian Clozel 提交于
      Prior to this commit, the resource handling chain and its
      `ResourceResolvers` would use specific `Resource` implementations in
      order to add resource metadata to the HTTP response. For example,
      `VersionedResource` and `EncodedResource` are both adding specific HTTP
      response headers.
      
      This commit aims at making this mechanism more stable and reusable,
      since the previous implementation would fail in case a resolved resource
      would be both a `VersionedResource` wrapping a `EncodedResource` (or the
      other way arount). Only one of the specific implementations would
      contribute its metadata since the code supporting that in
      `ResourceHttpRequestHandler` would only check for `instanceof` tests,
      whereas those implementations are acutally delegating calls to
      the wrapped resource.
      
      Now both `VersionedResource` and `EncodedResource` have been replaced by
      specific implementations of `ResolvedResource`, which directly provides
      those HTTP response headers as part of `getResponseHeaders()`.
      
      This commit applies the same changes for the web reactive
      implementations and its `ResourceWebHandler`.
      
      Issue: SPR-14264
      ccb3c44d
  28. 06 9月, 2016 2 次提交
  29. 31 8月, 2016 1 次提交
  30. 30 8月, 2016 1 次提交
  31. 05 7月, 2016 1 次提交
  32. 28 6月, 2016 1 次提交
    • R
      Fix MediaType lookup for ResourceHttpRequestHandler · e38623df
      Rossen Stoyanchev 提交于
      As of 4.3 ResourceHttpRequestHandler delegates to the configured
      ContentNegotiationManager, or one created internally, to look up
      the media type for are resource.
      
      This commit ensures the internally created ContentNegotiationManager is
      correctly injected with the ServletContext through which it can perform
      lookups as before.
      
      Also the ServletPathContentNegotiationStrategy now checks the
      ServletContext first and then delegates to its parent the
      PathContentNegotiationStrategy and not vice versa. This is
      consistent with how handleNoMatch (also in the same class) works
      and also matches how ResourceHttpRequestHandler worked before 4.3.
      
      Issue: SPR-14368
      e38623df
  33. 06 5月, 2016 1 次提交
  34. 23 3月, 2016 1 次提交