#include <http_core.h>
#include <http_connection.h>
#include <http_log.h>
+#include <http_ssl.h>
#include <nghttp2/nghttp2.h>
status = h2_request_end_headers(stream->rtmp, stream->pool, eos, raw_bytes);
if (APR_SUCCESS == status) {
set_policy_for(stream, stream->rtmp);
- stream->request = stream->rtmp;
- stream->rtmp = NULL;
-
+
ctx.maxlen = stream->session->s->limit_req_fieldsize;
ctx.failed_key = NULL;
- apr_table_do(table_check_val_len, &ctx, stream->request->headers, NULL);
+ apr_table_do(table_check_val_len, &ctx, stream->rtmp->headers, NULL);
if (ctx.failed_key) {
if (!h2_stream_is_ready(stream)) {
ap_log_cerror(APLOG_MARK, APLOG_INFO, 0, stream->session->c1,
/* keep on returning APR_SUCCESS, so that we send a HTTP response and
* do not RST the stream. */
}
+ if (stream->rtmp->scheme && strcasecmp(stream->rtmp->scheme,
+ ap_ssl_conn_is_ssl(stream->session->c1)? "https" : "http")) {
+ ap_log_cerror(APLOG_MARK, APLOG_INFO, 0, stream->session->c1,
+ H2_STRM_LOG(APLOGNO(), stream,"Request :scheme '%s' and "
+ "connection do not match."), stream->rtmp->scheme);
+ set_error_response(stream, HTTP_BAD_REQUEST);
+ }
+ stream->request = stream->rtmp;
+ stream->rtmp = NULL;
}
return status;
}
assert 1024 == len(r.response["body"])
assert "content-length" in h
assert clen == h["content-length"]
+
+ # use an invalid scheme
+ def test_h2_003_51(self, env):
+ url = env.mkurl("https", "cgi", "/")
+ opt = ["-H:scheme: http"]
+ r = env.nghttp().get(url, options=opt)
+ assert r.exit_code == 0, r
+ assert r.response['status'] == 400