-
-
Notifications
You must be signed in to change notification settings - Fork 56
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
New way of building 404 error HTML responses #732
Conversation
Codecov Report
@@ Coverage Diff @@
## master #732 +/- ##
==========================================
+ Coverage 57.83% 58.31% +0.48%
==========================================
Files 56 56
Lines 3652 3697 +45
Branches 2048 2069 +21
==========================================
+ Hits 2112 2156 +44
- Misses 1539 1540 +1
Partials 1 1
Continue to review full report at Codecov.
|
This was done in preparation for removing the `bookName` and `bookTitle` parameters from `Response::build_404()`, but since the new function could already be put to some use in this commit that was done too.
Instead of passing the `bookName` and `bookTitle` parameters to `Response::build_404()`, `withTaskbarInfo()` is applied to its result when needed. Note, that in `InternalServer::handle_raw()` `withTaskbarInfo()` was not utilized since the results of the `/raw` endpoint are not supposed to be decorated with a taskbar.
The fact that an info message was moved into C++ code is temporary since it will be moved to a message resource file soon.
After this change it's time to say thank you and good-bye to `withTaskbarInfo()`. But it will take a while.
One more instance of `Response::build_404()` & `withTaskbarInfo()` was taken over by `HTTP404HtmlResponse`.
93b7e59
to
ec2e10b
Compare
Rebased on master |
I like the combination concept you introduce with this PR. This create a more cleaner way to create responses. |
@veloman-yunkan @mgautierfr Would be great to fix the |
I'm on it #735 |
This is the next step on our path to internationalizing kiwix-serve (and making #679 a smaller PR).
The main goal of this PR was to introduce a new eDSL like way of building error responses. Here it is done only for 404 HTML error responses. A couple of further generalizations still remain in #679 because those enhancements were a little too dependent (factually but not conceptually) on the changes related to the internationalization of kiwix-serve.