| 713 | |
| 714 | |
| 715 | struct Unauthorized : Response |
| 716 | { |
| 717 | explicit Unauthorized(const std::vector<std::string>& challenges) |
| 718 | : Unauthorized(challenges, "401 Unauthorized.") {} |
| 719 | |
| 720 | Unauthorized( |
| 721 | const std::vector<std::string>& challenges, |
| 722 | const std::string& body) |
| 723 | : Response(body, Status::UNAUTHORIZED) |
| 724 | { |
| 725 | // TODO(arojas): Many HTTP client implementations do not support |
| 726 | // multiple challenges within a single 'WWW-Authenticate' header. |
| 727 | // Once MESOS-3306 is fixed, we can use multiple entries for the |
| 728 | // same header. |
| 729 | headers["WWW-Authenticate"] = strings::join(", ", challenges); |
| 730 | } |
| 731 | }; |
| 732 | |
| 733 | |
| 734 | struct Forbidden : Response |
no outgoing calls