Skip to content

Commit 1f8c682

Browse files
authored
Add CLOUDFLARE_CONNECTION env variable
Untested yet, lol @reader, if I don't change anything, it probably works
1 parent 98ab38a commit 1f8c682

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

mod_cloudflare.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,11 +282,12 @@ static int cloudflare_modify_connection(request_rec *r)
282282
const char *cf_visitor_header = NULL;
283283

284284
apr_pool_userdata_get((void*)&conn, "mod_cloudflare-conn", c->pool);
285+
286+
apr_table_t *e = r->subprocess_env;
285287

286288
cf_visitor_header = apr_table_get(r->headers_in, "CF-Visitor");
287289
if (cf_visitor_header != NULL) {
288290
if ((remote) && (strstr(cf_visitor_header, "https") != NULL)) {
289-
apr_table_t *e = r->subprocess_env;
290291
apr_table_addn(e, "HTTPS", "on");
291292
}
292293
}
@@ -371,6 +372,8 @@ static int cloudflare_modify_connection(request_rec *r)
371372
} else {
372373
break;
373374
}
375+
} else {
376+
apr_table_addn(e, "CLOUDFLARE_CONNECTION", "true");
374377
}
375378
}
376379

0 commit comments

Comments
 (0)