paytrail / paytrail-for-woocommerce

Paytrail payment service for WooCommerce
MIT License
4 stars 10 forks source link

Fix REST request validation by directly checking $_SERVER vars #137

Closed ot-st closed 7 months ago

ot-st commented 7 months ago

Related tickets & documents

None

Description

This pull request addresses a critical flaw in the validate_request method where it incorrectly assumed the state of a newly instantiated WP_REST_Request object without parameters. Originally, the method attempted to validate the request method and content type using this uninitialized object, leading to a logical mistake where the validation could never properly execute due to the absence of correctly set values within the WP_REST_Request object.

Key Changes: