Returns true if `request` contains an inbound libprocess message. A libprocess message can either be sent by another instance of libprocess (i.e. both of the "User-Agent" and "Libprocess-From" headers will be set), or a client that speaks the libprocess protocol (i.e. only the "Libprocess-From" header will be set). This function returns true for either case.
| 702 | // protocol (i.e. only the "Libprocess-From" header will be set). |
| 703 | // This function returns true for either case. |
| 704 | static bool libprocess(Request* request) |
| 705 | { |
| 706 | return |
| 707 | (request->method == "POST" && |
| 708 | request->headers.contains("User-Agent") && |
| 709 | request->headers["User-Agent"].find("libprocess/") == 0) || |
| 710 | (request->method == "POST" && |
| 711 | request->headers.contains("Libprocess-From")); |
| 712 | } |
| 713 | |
| 714 | |
| 715 | // Returns a 'BODY' request once the body of the provided |