/
[in-link] Memory leak during link validation [5.2.2-B1]
[in-link] Memory leak during link validation [5.2.2-B1]
The link validation feature of In-Link will automatically validate URLs of all created links. The validation is done by making a HTTP GET request to validated URL and checking response code. This works fine, when validating URLs to pages.
Using GET request can however result in a memory leaks, when validated URLs lead to large downloadable files, because file is downloaded completely and only then response HTTP code is checked.
Solution
- Make HEAD request instead of GET request. Specify "CURLOPT_NOBODY" option to "kCurlHelper" class before making the HTTP request in the "LinkValidationEventHandler::_validateLink" method.
- When HEAD request fails (some websites block HEAD requests) do a GET request.