clach04 / webook_server

💩📖 Worst E-book server - light weight OPDS and web server that converts ebook formats on the fly, using Python (2 or 3) and optional Calibre convert
GNU General Public License v3.0
4 stars 0 forks source link

test special filenames, non-ascii and special html characters #7

Open clach04 opened 2 years ago

clach04 commented 2 years ago

Test:

demo directory:

$ ls -a sample_reading_media/dir\ with\ spaces/
 .                      'double_quotes_"name"_epub.epub'  'square_brackets_[name]_epub.epub'
 ..                     "single_quotes_'name'_epub.epub"  'test book epub.epub'
'ampersand_&epub.epub'  'spaces book epub.epub'            test_book_epub.epub
'test_with_greater_than_html<1>_epub.epub'

Samples

using https://github.com/clach04/sample_reading_media/

$ find sample_reading_media/
sample_reading_media/
sample_reading_media/epubs
sample_reading_media/epubs/test_book_epub.epub
sample_reading_media/epubs/test_book(epub).epub
sample_reading_media/epubs/test book epub.epub
sample_reading_media/epubs/test book (epub).epub
sample_reading_media/test_book_fb2.fb2
sample_reading_media/test_book.md
sample_reading_media/test_book_txt.txt
sample_reading_media/test_book_epub.epub
sample_reading_media/test_book_pdf.pdf
sample_reading_media/test_book_md.md
sample_reading_media/test_book_odt.odt
sample_reading_media/test_book_docx.docx
sample_reading_media/test_book_fb2_zip.zip
sample_reading_media/test_book_html.html
sample_reading_media/empty_dir
sample_reading_media/single_quote_search_filename_problem
sample_reading_media/single_quote_search_filename_problem/test_book_epub.epub
sample_reading_media/single_quote_search_filename_problem/single_quotes_'name'_epub.epub
sample_reading_media/single_quote_search_filename_problem/test_with_greater_than_html<1>_epub.epub
sample_reading_media/dir with spaces
sample_reading_media/dir with spaces/double_quotes_"name"_epub.epub
sample_reading_media/dir with spaces/test_book_epub.epub
sample_reading_media/dir with spaces/square_brackets_[name]_epub.epub
sample_reading_media/dir with spaces/spaces book epub.epub
sample_reading_media/dir with spaces/ampersand_&epub.epub
sample_reading_media/dir with spaces dupe
sample_reading_media/dir with spaces dupe/double_quotes_"name"_epub.epub
sample_reading_media/dir with spaces dupe/test_book_epub.epub
sample_reading_media/dir with spaces dupe/single_quotes_'name'_epub.epub
sample_reading_media/dir with spaces dupe/square_brackets_[name]_epub.epub
sample_reading_media/dir with spaces dupe/spaces book epub.epub
sample_reading_media/dir with spaces dupe/ampersand_&epub.epub
sample_reading_media/test_book_txt_zip.zip
sample_reading_media/test_book_html_zip.zip
sample_reading_media/test_book_md_zip.zip

Notes

clach04 commented 2 years ago

ampersand handled via https://github.com/clach04/webook_server/commit/6d92dbe0044a1c86cef23178174f358217dba65e

pound/hash '#' is a browser issue

clach04 commented 1 year ago

Greater than and less than handled via https://github.com/clach04/webook_server/commit/ef2493e2dee9ad4d62e5560e14ec2b8267dcb1b3