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

HEAD requests not supported #507

Closed
chris968 opened this issue Mar 7, 2024 · 4 comments
Closed

HEAD requests not supported #507

chris968 opened this issue Mar 7, 2024 · 4 comments
Assignees

Comments

@chris968
Copy link

chris968 commented Mar 7, 2024

ISSUE NAME

  • Passbolt Version: 4.5.2 (CE)
  • Platform and Target:
    -- Operating system: CentOS 7
    -- PHP: 7.4
    -- Web server: nginx
    -- Database server: mariadb

HEAD requests are deactivated on all routes, some monitoring platform only support HEAD request (this might depend on subscription level).
It could be interesting to support HEAD requests, one some routes at least, if there is no security concern of course.

@stripthis
Copy link
Member

Hello, Can you give us an example of such monitoring platform? Are you doing monitoring on client side or server side? Which API endpoints you would need in particular? Currently we have a GET /healthcheck/status.json that can be used by probes, so we could add HEAD for this.

@stripthis stripthis self-assigned this Mar 7, 2024
@chris968
Copy link
Author

chris968 commented Mar 7, 2024

I use free UptimeRobot subscription and it only support HEAD requests which is lead to a 404 error on any path I've tested. (/, /healthcheck/status.json, /healthcheck/status).
I manually modified the routes.php file and it worked as expected.

/**
 * Healthchecks routes
 */
$routes->scope('/healthcheck', function ($routes) {
    $routes->setExtensions(['json']);

    $routes->connect('/status', ['prefix' => 'Healthcheck', 'controller' => 'HealthcheckStatus', 'action' => 'status'])
        ->setMethods(['GET','HEAD']);

    $routes->connect('/', ['prefix' => 'Healthcheck', 'controller' => 'HealthcheckIndex', 'action' => 'index'])
        ->setMethods(['GET']);

    $routes->connect('/error', ['prefix' => 'Healthcheck', 'controller' => 'HealthcheckError', 'action' => 'internal'])
        ->setMethods(['GET','POST', 'PUT', 'DELETE']);
});

@stripthis
Copy link
Member

Sounds good we'll add this to the v4.7.

dlen pushed a commit that referenced this issue Apr 24, 2024
…support more uptime monitoring tools (GITHUB #507)
dlen pushed a commit that referenced this issue Apr 24, 2024
…checkstatusjson-to-support-more-uptime-monitoring-tools-GITHUB-507' into 'common'

PB-30330 Add HTTP HEAD method support to /healthcheck/status.json to support more uptime monitoring tools (GITHUB #507)

See merge request passbolt/passbolt-pro-api!1519
@ishanvyas22
Copy link
Member

Hey @chris968, support for HEAD method is released with v4.7. Feel free to try it out and thank you for your patience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants