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 incorrect message and HTTP status code when no instance is available #980

Commits on Apr 27, 2022

  1. Fix incorrect message and HTTP status code when no instance is available

    This bug has been around for at least 19 years, as described on [this thread](https://webobjects-dev.omnigroup.narkive.com/7gWK5EfH/http-500-error-a-nightmare). The WebObjects adaptor may return an incorrect HTTP status code and message when no instance of an application is available to handle the request. It's fairly easy to reproduce the problem:
    
    1. Set up a WebObjects application with a single instance.
    2. Try to access the application from a browser with the instance stopped.
    
    ```
    GET - /cgi-bin/WebObjects/my-app.woa/wa/default
    
    Status: 500
    Message: No instance available
    ```
    
    3. Reload the browser, and you'll get a different response.
    
    ```
    GET - /cgi-bin/WebObjects/my-app.woa/wa/default
    
    Status: 404
    Message: The requested application was not found on this server
    ```
    
    When no instance is available, returning a 404 status code is problematic, especially if the URL being accessed is part of a REST API. This fix will ensure that the WebObjects adaptor will return the correct HTTP status code and message for every request when no instance is available.
    hprange committed Apr 27, 2022
    Configuration menu
    Copy the full SHA
    7c6ee30 View commit details
    Browse the repository at this point in the history