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

Fix regression when using empty values for --page-fallback or SERVER_FALLBACK_PAGE #219

Merged
merged 1 commit into from
Jun 8, 2023

Conversation

joseluisq
Copy link
Collaborator

Description

This PR fixes a regression when using empty values for --page-fallback or SERVER_FALLBACK_PAGE

error: a value is required for '--page-fallback <PAGE_FALLBACK>' but none was supplied

Related Issue

Resolves #218

Motivation and Context

How Has This Been Tested?

Provide --page-fallback="" or its SERVER_FALLBACK_PAGE= using empty values and run the server:

static-web-server -p 8787 -d docker/public/ -g trace -x -z --page-fallback=""

Then you will see the following logs (expected):

2023-06-08T20:34:13.806318Z  INFO static_web_server::logger: logging level: trace
2023-06-08T20:34:13.806540Z DEBUG static_web_server::server: initializing tokio runtime with multi thread scheduler self.worker_threads=8
2023-06-08T20:34:13.808290Z TRACE static_web_server::server: starting web server
2023-06-08T20:34:13.808557Z  INFO static_web_server::server: server bound to tcp socket [::]:8787
2023-06-08T20:34:13.808795Z  INFO static_web_server::server: fallback page: enabled=false, value=""

Screenshots (if appropriate):

error: a value is required for '--page-fallback <PAGE_FALLBACK>' but none was supplied

now is ok to pass an empty --page-fallback argument or empty SERVER_FALLBACK_PAGE

log example when --page-fallback or its env is empty:

2023-06-08T20:34:13.806318Z  INFO static_web_server::logger: logging level: trace
2023-06-08T20:34:13.806540Z DEBUG static_web_server::server: initializing tokio runtime with multi thread scheduler self.worker_threads=8
2023-06-08T20:34:13.808290Z TRACE static_web_server::server: starting web server
2023-06-08T20:34:13.808557Z  INFO static_web_server::server: server bound to tcp socket [::]:8787
2023-06-08T20:34:13.808795Z  INFO static_web_server::server: fallback page: enabled=false, value=""
@joseluisq joseluisq added v2 v2 release bugfix This is PR fixes a bug labels Jun 8, 2023
@joseluisq joseluisq self-assigned this Jun 8, 2023
@joseluisq joseluisq merged commit 3e4bd47 into master Jun 8, 2023
25 of 26 checks passed
@joseluisq joseluisq deleted the fix-error-when-empty-page-fallback-value branch June 8, 2023 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This is PR fixes a bug v2 v2 release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2.18 regression: errors out with empty SERVER_FALLBACK_PAGE
1 participant