File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ type status_code =
3636 | `No_content
3737 | `Found
3838 | `Moved
39+ | `Permanent_redirect
3940 | `Bad_request
4041 | `Unauthorized
4142 | `Payment_required
@@ -125,6 +126,7 @@ let status_code : reply_status -> int = function
125126
126127 | `Moved -> 301
127128 | `Found -> 302
129+ | `Permanent_redirect -> 308
128130
129131 | `Bad_request -> 400
130132 | `Unauthorized -> 401
@@ -159,6 +161,7 @@ let show_status_code : status_code -> string = function
159161
160162 | `Moved -> " 301 Moved Permanently"
161163 | `Found -> " 302 Found"
164+ | `Permanent_redirect -> " 308 Permanent Redirect"
162165
163166 | `Bad_request -> " 400 Bad Request"
164167 | `Unauthorized -> " 401 Unauthorized"
Original file line number Diff line number Diff line change @@ -12,6 +12,12 @@ let test name f = let open OUnit in tests := (name >:: f) :: !tests
1212
1313let strl = Stre. list
1414
15+ let () = test " Httpev permanent redirect" begin fun () ->
16+ assert_equal 308 (Httpev. status_code `Permanent_redirect );
17+ assert_equal ~printer: id " HTTP/1.1 308 Permanent Redirect"
18+ (Httpev. show_http_reply ~version: `Http_1_1 `Permanent_redirect )
19+ end
20+
1521let () = test " HtmlStream" begin fun () ->
1622 Printexc. record_backtrace true ;
1723 let module HS = HtmlStream in
You can’t perform that action at this time.
0 commit comments