| 766 | } |
| 767 | |
| 768 | function reason(status) |
| 769 | { |
| 770 | const message = ` |
| 771 | 100 Continue |
| 772 | 101 Switching Protocols |
| 773 | 200 OK |
| 774 | 201 Created |
| 775 | 202 Accepted |
| 776 | 203 Non-Authoritative Information |
| 777 | 204 No Content |
| 778 | 205 Reset Content |
| 779 | 206 Partial Content |
| 780 | 207 Multi-Status |
| 781 | 300 Multiple Choices |
| 782 | 301 Moved Permanently |
| 783 | 302 Found |
| 784 | 303 See Other |
| 785 | 304 Not Modified |
| 786 | 305 Use Proxy |
| 787 | 307 Temporary Redirect |
| 788 | 400 Bad Request |
| 789 | 401 Unauthorized |
| 790 | 402 Payment Required |
| 791 | 403 Forbidden |
| 792 | 404 Not Found |
| 793 | 405 Method Not Allowed |
| 794 | 406 Not Acceptable |
| 795 | 407 Proxy Authentication Required |
| 796 | 408 Request Timeout |
| 797 | 409 Conflict |
| 798 | 410 Gone |
| 799 | 411 Length Required |
| 800 | 412 Precondition Failed |
| 801 | 413 Request Entity Too Large |
| 802 | 414 Request-URI Too Long |
| 803 | 415 Unsupported Media Type |
| 804 | 416 Requested Range Not Satisfiable |
| 805 | 417 Expectation Failed |
| 806 | 500 Internal Server Error |
| 807 | 501 Not Implemented |
| 808 | 502 Bad Gateway |
| 809 | 503 Service Unavailable |
| 810 | 504 Gateway Timeout |
| 811 | 505 HTTP Version Not Supported |
| 812 | `; |
| 813 | let index = message.indexOf(`\n${status} `); |
| 814 | if (index < 0) return "OK"; |
| 815 | return message.substring(index + 5, message.indexOf("\n", index + 1)); |
| 816 | } |
| 817 | |
| 818 | export default Object.freeze({ |
| 819 | Request, |