#include "ext/standard/html.h"
#include "ext/standard/url.h" /* for php_raw_url_decode() */
#include "ext/standard/php_string.h" /* for php_dirname() */
+#include "ext/date/php_date.h" /* for php_format_date() */
#include "php_network.h"
#include "php_http_parser.h"
smart_str_appendl_ex(buffer, "\r\n", 2, persistent);
}
}
+ time_t t;
+ time(&t);
+ zend_string *dt = php_format_date("r", 1, t, 1);
+ smart_str_appendl_ex(buffer, "Date: ", 6, persistent);
+ smart_str_appends_ex(buffer, dt->val, persistent);
+ smart_str_appendl_ex(buffer, "\r\n", 2, persistent);
+
smart_str_appendl_ex(buffer, "Connection: close\r\n", sizeof("Connection: close\r\n") - 1, persistent);
} /* }}} */
--EXPECTF--
HTTP/1.1 200 OK
Host: localhost
+Date: %s
Connection: close
X-Powered-By: %s
Content-type: text/html; charset=UTF-8
OK
HTTP/1.0 500 Internal Server Error
Host: localhost
+Date: %s
Connection: close
X-Powered-By: %s
Content-type: text/html; charset=UTF-8
HTTP/1.0 500 Internal Server Error
Host: localhost
+Date: %s
Connection: close
X-Powered-By: %s
Content-type: text/html; charset=UTF-8
HTTP/1.0 500 Internal Server Error
Host: localhost
+Date: %s
Connection: close
X-Powered-By: %s
Content-type: text/html; charset=UTF-8
--EXPECTF--
HTTP/1.1 100 Continue
Host: %s
+Date: %s
Connection: close
X-Powered-By: PHP/%s
Content-type: text/html; charset=UTF-8
--EXPECTF--
HTTP/1.1 422 Unknown Status Code
Host: %s
+Date: %s
Connection: close
X-Powered-By: PHP/%s
Content-type: text/html; charset=UTF-8
--EXPECTF--
HTTP/1.1 511 Network Authentication Required
Host: %s
+Date: %s
Connection: close
X-Powered-By: PHP/%s
Content-type: text/html; charset=UTF-8
?>
--EXPECTF--
HTTP/1.1 200 OK
+Date: %s
Connection: close
X-Powered-By: %s
Content-type: text/html; charset=UTF-8
--EXPECTF--
HTTP/1.1 200 OK
Host: %s
+Date: %s
Connection: close
X-Powered-By: PHP/%s
Content-type: text/html; charset=UTF-8
--EXPECTF--
HTTP/1.1 200 OK
Host: %s
+Date: %s
Connection: close
X-Powered-By: %s
Content-type: text/html; charset=UTF-8
?>
--EXPECTF--
HTTP/1.1 308 Permanent Redirect
+Date: %s
Connection: close
X-Powered-By: %s
Content-type: text/html; charset=UTF-8
HTTP/1.1 426 Upgrade Required
+Date: %s
Connection: close
X-Powered-By: %s
Content-type: text/html; charset=UTF-8
?>
--EXPECTF--
HTTP/1.1 200 OK
+Date: %s
Connection: close
X-Powered-By: %s
Content-type: text/html; charset=UTF-8
--EXPECTF--
HTTP/1.1 200 OK
Host: %s
+Date: %s
Connection: close
X-Powered-By: PHP/%s
Content-type: text/html; charset=UTF-8
--EXPECTF--
HTTP/1.1 200 OK
Host: %s
+Date: %s
Connection: close
X-Powered-By: PHP/%s
Content-type: text/html; charset=UTF-8
--EXPECTF--
HTTP/1.1 200 OK
Host: %s
+Date: %s
Connection: close
X-Powered-By: PHP/%s
Content-type: text/html; charset=UTF-8
--EXPECTF--
HTTP/1.1 200 OK
Host: %s
+Date: %s
Connection: close
X-Powered-By: PHP/%s
Content-type: text/html; charset=UTF-8
--EXPECTF--
HTTP/1.1 401 Unauthorized
Host: %s
+Date: %s
Connection: close
X-Powered-By: PHP/%s
WWW-Authenticate: Digest realm="foo",qop="auth",nonce="XXXXX",opaque="acbd18db4cc2f85cedef654fccc4a4d8"
--EXPECTF--
HTTP/1.1 200 OK
Host: %s
+Date: %s
Connection: close
X-Powered-By: PHP/%s
Content-type: text/html; charset=UTF-8
string(8) "HTTP/1.1"
HTTP/1.0 200 OK
Host: %s
+Date: %s
Connection: close
X-Powered-By: PHP/%s
Content-type: text/html; charset=UTF-8
--EXPECTF--
HTTP/1.1 200 OK
Host: %s
+Date: %s
Connection: close
X-Powered-By: PHP/%s
Content-type: text/html; charset=UTF-8
string(8) "/foo/bar"
HTTP/1.0 200 OK
Host: %s
+Date: %s
Connection: close
X-Powered-By: PHP/%s
Content-type: text/html; charset=UTF-8
--EXPECTF--
HTTP/1.1 200 OK
Host: %s
+Date: %s
Connection: close
X-Powered-By: PHP/%s
Content-type: text/html; charset=UTF-8
string(7) "foo=bar"
HTTP/1.0 200 OK
Host: %s
+Date: %s
Connection: close
X-Powered-By: PHP/%s
Content-type: text/html; charset=UTF-8
--EXPECTF--
HTTP/1.1 200 OK
Host: %s
+Date: %s
Connection: close
X-Powered-By: PHP/%s
Content-type: text/html; charset=UTF-8
HTTP/1.1 404 Not Found
Host: %s
+Date: %s
Connection: close
Content-Type: text/html; charset=UTF-8
Content-Length: %d
</head><body><h1>Not Found</h1><p>The requested resource <code class="url">/</code> was not found on this server.</p></body></html>
HTTP/1.1 404 Not Found
Host: %s
+Date: %s
Connection: close
Content-Type: text/html; charset=UTF-8
Content-Length: %d
</head><body><h1>Not Found</h1><p>The requested resource <code class="url">/main/style.css</code> was not found on this server.</p></body></html>
HTTP/1.1 404 Not Found
Host: %s
+Date: %s
Connection: close
Content-Type: text/html; charset=UTF-8
Content-Length: %d
HTTP/1.1 200 OK
Host: %s
+Date: %s
Connection: close
X-Powered-By: %s
Content-type: %s
done
HTTP/1.1 404 Not Found
Host: %s
+Date: %s
Connection: close
Content-Type: %s
Content-Length: %d
--EXPECTF--
HTTP/1.1 200 OK
Host: %s
+Date: %s
Connection: close
X-Powered-By: PHP/%s
Content-type: text/html; charset=UTF-8
--EXPECTF--
HTTP/1.1 200 OK
Host: %s
+Date: %s
Connection: close
X-Powered-By: %s
Content-type: text/html; charset=UTF-8
--EXPECTF--
HTTP/1.1 200 OK
Host: %s
+Date: %s
Connection: close
X-Powered-By: %s
Content-type: text/html; charset=UTF-8
--EXPECTF--
HTTP/1.1 200 OK
Host: %s
+Date: %s
Connection: close
X-Powered-By: %s
Bar-Foo: Foo
--EXPECTF--
HTTP/1.1 200 OK
Host: %s
+Date: %s
Connection: close
X-Powered-By: PHP/%s
Content-type: text/html; charset=UTF-8
HTTP/1.1 200 OK
Host: %s
+Date: %s
Connection: close
X-Powered-By: PHP/%s
Content-type: text/html; charset=UTF-8