Skip to content
Snippets Groups Projects
  1. Apr 24, 2024
  2. Apr 17, 2024
  3. Apr 16, 2024
    • Antoine Lambert's avatar
      browse/utils: Reinstate chardet use but only as a fallback · 38204c22
      Antoine Lambert authored
      While charset_normalizer performs usually better than chardet, it
      remains some edge cases where it can fail to detect content encoding
      while chardet succeeds.
      
      So try to detect content encoding with chardet as a fallback when
      charset_normalizer failed.
      38204c22
  4. Apr 12, 2024
  5. Apr 11, 2024
    • Antoine Lambert's avatar
      requirements: Turn beautifulsoup4 into a test dependency · 002b56dc
      Antoine Lambert authored
      It is now only used in the test suites so no need to keep it as
      a runtime dependency, also remove not required lxml dependency.
      002b56dc
    • Jérémy Bobbio (Lunar)'s avatar
      Remove HtmlPrettifyMiddleware (used in development mode) · ca9cf431
      Jérémy Bobbio (Lunar) authored
      HtmlPrettifyMiddleware uses the `prettify()` method from BeautifulSoup.
      Its documentation says:
      
      > Since it adds whitespace (in the form of newlines), `prettify()` changes
      > the meaning of an HTML document and should not be used to reformat one.
      > The goal of `prettify()` is to help you visually understand the structure
      > of the documents you work with.
      
      Having HtmlPrettifyMiddleware enabled therefore leads to surprising
      behavior, like extra spaces surrounding “something” when writing
      `<code>something</code>` in a template.
      
      Now that Django templates are prettified using `djlint`, this middleware
      only has downsides. Let’s remove it entirely.
      ca9cf431
    • Antoine Lambert's avatar
      browse: Add rate limit to content views to avoid abuses · 697a8a58
      Antoine Lambert authored
      It has been observed that some users are scraping the browse content
      views at a high rate by sending too many requests in a short amount
      of time.
      
      So add a rate limit of sixty requests per minute to content views to
      avoid such abuse by using the django-ratelimit package.
      
      Related to #4795.
      v0.4.1
      697a8a58
  6. Apr 10, 2024
  7. Apr 09, 2024
  8. Apr 02, 2024
  9. Mar 31, 2024
  10. Mar 29, 2024
  11. Mar 28, 2024
  12. Mar 27, 2024
    • David Douard's avatar
      Fix OriginInfo: use a list instead of a set for visit_types · b77a86c8
      David Douard authored
      This matches what swh-search returns and expects. This could make
      test_lookup_origin() (in test_archive.py) fail when the bad luck (?) made
      hypothesis generate a test set where swh-search's in-memory backend
      tries to merge the visit_types with an existing one (thus trying to add
      a pair set objects).
      
      Adapt the definition of OriginInfo (more or less the local version of
      swh-search's OriginDict) accordingly.
      b77a86c8
    • Antoine Lambert's avatar
      tox: Simplify tests setup after pytest 8.1 release · c08347bf
      Antoine Lambert authored
      Since the release of pytest 8.1, some pytest options are no longer
      needed and editable install can be used when running tests using tox.
      c08347bf
  13. Mar 22, 2024
    • Antoine Lambert's avatar
      browse/search: Handle visit type when search pattern is an origin URL · 4ce23c9a
      Antoine Lambert authored and Antoine Lambert's avatar Antoine Lambert committed
      When searching for origins with the Web UI, if the search pattern is equal
      to the URL of an archived origin then user gets automatically redirected to
      the interface for browsing it.
      
      Previously the visit type was not taken into account prior performing the
      redirection so ensure to redirect only if the origin has a visit type
      that matches the selected one.
      4ce23c9a
  14. Mar 14, 2024
    • Antoine Lambert's avatar
      conftest: Improve mocking of webpack stats · f98b1824
      Antoine Lambert authored
      Instead of writing a dummy webpack-stats.json file into the static folder
      of swh-web when pytest is configured, prefer to autouse a session scoped
      fixture mocking the return value of WebpackLoader.load_assets.
      f98b1824
  15. Mar 13, 2024
  16. Mar 01, 2024
  17. Feb 28, 2024
Loading