Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Full URI-encoding of URLs returned by kiwix-serve #890

Merged
merged 11 commits into from
Feb 9, 2023

Commits on Feb 8, 2023

  1. Proper URI-encoding in InternalServer::build_redirect()

    - Before this change `InternalServer::build_redirect()` only URI-encoded the
      article path, ignoring the book name and/or the root location components of
      the URL.
    
    - In order to be able to test this fix, corner_cases.zim was renamed to
      contain a couple of special URL symbols in its filename. The
      `create_corner_cases_zim_file` script was updated accordingly.
    veloman-yunkan committed Feb 8, 2023
    Configuration menu
    Copy the full SHA
    2e9bec9 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    58bb8b9 View commit details
    Browse the repository at this point in the history
  3. URI-encoding when redirecting legacy URLs to /content

    Testing of this functionality revealed that the query part containing +
    symbols (as replacement for spaces in the parameter values) isn't
    forwarded properly as the + symbols are URI-encoded (this is a bug on
    the part of the `RequestContext::get_query()` the result of which
    already contains URI-encoded +'s).
    veloman-yunkan committed Feb 8, 2023
    Configuration menu
    Copy the full SHA
    a807ce2 View commit details
    Browse the repository at this point in the history
  4. Passing of unrooted URL into RequestContext()

    This change doesn't make much sense on its own - the real goal is to
    prepare some ground for easier implementation of URI-encoding of the root
    location.
    veloman-yunkan committed Feb 8, 2023
    Configuration menu
    Copy the full SHA
    71a66e0 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    2c5e84b View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    a7fe419 View commit details
    Browse the repository at this point in the history
  7. Saving a few CPU cycles

    This silly optimization in fact helps to avoid a somewhat more serious
    waste of CPU cycles that would otherwise result in the next commit.
    veloman-yunkan committed Feb 8, 2023
    Configuration menu
    Copy the full SHA
    97f0314 View commit details
    Browse the repository at this point in the history

Commits on Feb 9, 2023

  1. URI-encoding of the root location part

    Now the root location is URI-encoded too.
    
    In order to properly test this change the root location in the tests was
    changed from "/ROOT" to "/ROOT#?" (or "/ROOT%23%3F" in URI-encoded form),
    which is why this commit is so big.
    veloman-yunkan committed Feb 9, 2023
    Configuration menu
    Copy the full SHA
    05a66ea View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    02f631f View commit details
    Browse the repository at this point in the history
  3. Renamed a data member

    veloman-yunkan committed Feb 9, 2023
    Configuration menu
    Copy the full SHA
    c2fffac View commit details
    Browse the repository at this point in the history
  4. fixup! URI-encoding when redirecting legacy URLs to /content

    The alleged bug seems rather an issue with httplib which seems to
    URI-encode any + present in query parameters.
    veloman-yunkan committed Feb 9, 2023
    Configuration menu
    Copy the full SHA
    51206f4 View commit details
    Browse the repository at this point in the history