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

Modernize the webserver code (part 1) #17661

Merged
merged 4 commits into from
Feb 12, 2024

Commits on Feb 11, 2024

  1. Configuration menu
    Copy the full SHA
    12b9685 View commit details
    Browse the repository at this point in the history
  2. Extract and modernize the webserver's file serving code

    The `handler` method contained this code in an inline function, which
    made the `handler` method big and harder to read. Moreover, this code
    relied on variables from the outer scope, which made it harder to reason
    about because the inputs and outputs weren't easily visible.
    
    This commit fixes the problems by extracting the file serving code into
    a dedicated private method, and modernizing it to use e.g. `const`/`let`
    instead of `var` and using template strings.
    timvandermeij committed Feb 11, 2024
    Configuration menu
    Copy the full SHA
    56d9930 View commit details
    Browse the repository at this point in the history
  3. Extract and modernize the webserver's range file serving code

    The `handler` method contained this code in an inline function, which
    made the `handler` method big and harder to read. Moreover, this code
    relied on variables from the outer scope, which made it harder to reason
    about because the inputs and outputs weren't easily visible.
    
    This commit fixes the problems by extracting the range file serving code
    into a dedicated private method, and modernizing it to use e.g. `const`/
    `let` instead of `var` and using template strings.
    timvandermeij committed Feb 11, 2024
    Configuration menu
    Copy the full SHA
    336fcff View commit details
    Browse the repository at this point in the history
  4. Extract and modernize the webserver's directory listing code

    The `handler` method contained this code in an inline function, which
    made the `handler` method big and harder to read. Moreover, this code
    relied on variables from the outer scope, which made it harder to reason
    about because the inputs and outputs weren't easily visible.
    
    This commit fixes the problems by extracting the directory listing code
    into a dedicated private method, and modernizing it to use e.g. `const`/
    `let` instead of `var` and using template strings.
    timvandermeij committed Feb 11, 2024
    Configuration menu
    Copy the full SHA
    ce4fe0c View commit details
    Browse the repository at this point in the history