LCOV - code coverage report
Current view: top level - src/util - url.cpp (source / functions) Hit Total Coverage
Test: total_coverage.info Lines: 9 9 100.0 %
Date: 2020-09-26 01:30:44 Functions: 1 1 100.0 %

          Line data    Source code
       1             : // Copyright (c) 2015-2019 The Bitcoin Core developers
       2             : // Distributed under the MIT software license, see the accompanying
       3             : // file COPYING or http://www.opensource.org/licenses/mit-license.php.
       4             : 
       5             : #include <util/url.h>
       6             : 
       7             : #include <event2/http.h>
       8             : #include <stdlib.h>
       9             : #include <string>
      10             : 
      11        1730 : std::string urlDecode(const std::string &urlEncoded) {
      12        1730 :     std::string res;
      13        1730 :     if (!urlEncoded.empty()) {
      14        1570 :         char *decoded = evhttp_uridecode(urlEncoded.c_str(), false, nullptr);
      15        1570 :         if (decoded) {
      16        1570 :             res = std::string(decoded);
      17        1570 :             free(decoded);
      18             :         }
      19        1570 :     }
      20             :     return res;
      21        1730 : }

Generated by: LCOV version 1.15