Header utilities
| 4803 | |
| 4804 | // Header utilities |
| 4805 | inline std::pair<std::string, std::string> make_range_header(Ranges ranges) { |
| 4806 | std::string field = "bytes="; |
| 4807 | auto i = 0; |
| 4808 | for (auto r : ranges) { |
| 4809 | if (i != 0) { field += ", "; } |
| 4810 | if (r.first != -1) { field += std::to_string(r.first); } |
| 4811 | field += '-'; |
| 4812 | if (r.second != -1) { field += std::to_string(r.second); } |
| 4813 | i++; |
| 4814 | } |
| 4815 | return std::make_pair("Range", std::move(field)); |
| 4816 | } |
| 4817 | |
| 4818 | inline std::pair<std::string, std::string> |
| 4819 | make_basic_authentication_header(const std::string &username, |
nothing calls this directly
no test coverage detected