[v0.8.4] Add HTTPS agent and PATCH method support- #295
This pull request updates the 4Hands API to version 0.8.4 and introduces improvements to the AJAX service, focusing on enhanced HTTPS agent handling and expanded HTTP method support. The most important changes are summarized below.
Version Updates
- Updated the version in both
README.mdandpackage.jsonfrom 0.8.3 to 0.8.4 to reflect the new release. [1] [2]
AJAX Service Enhancements (client/services/AJAX.js)
HTTPS Agent Handling
- Improved the logic for setting the
httpsAgentandhttpAgentproperties: now, ifNODE_ENVis'production', requests will always reject unauthorized SSL certificates, increasing security in production environments. [1] [2] - Ensured that all HTTP methods (
get,post,put,patch,delete, and file uploads) consistently use the correct agent settings by passinghttpsAgentandhttpAgentin every request. [1] [2] [3] [4] [5]
Expanded HTTP Method Support
- Added a new
patchmethod to support HTTP PATCH requests, including authentication handling. - Added a new
authPatchmethod to perform authenticated PATCH requests, mirroring the pattern used for other HTTP verbs.