MCPcopy Create free account
hub / github.com/apache/httpd / get_url_scheme

Function get_url_scheme

modules/proxy/mod_proxy_http.c:34–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32 request_rec *r, int flags, int *read);
33
34static const char *get_url_scheme(const char **url, int *is_ssl)
35{
36 const char *u = *url;
37
38 switch (u[0]) {
39 case 'h':
40 case 'H':
41 if (strncasecmp(u + 1, "ttp", 3) == 0) {
42 if (u[4] == ':') {
43 *is_ssl = 0;
44 *url = u + 5;
45 return "http";
46 }
47 if (apr_tolower(u[4]) == 's' && u[5] == ':') {
48 *is_ssl = 1;
49 *url = u + 6;
50 return "https";
51 }
52 }
53 break;
54
55 case 'w':
56 case 'W':
57 if (apr_tolower(u[1]) == 's') {
58 if (u[2] == ':') {
59 *is_ssl = 0;
60 *url = u + 3;
61 return "ws";
62 }
63 if (apr_tolower(u[2]) == 's' && u[3] == ':') {
64 *is_ssl = 1;
65 *url = u + 4;
66 return "wss";
67 }
68 }
69 break;
70 }
71
72 *is_ssl = 0;
73 return NULL;
74}
75
76/*
77 * Canonicalise http-like URLs.

Callers 2

proxy_http_canonFunction · 0.85
proxy_http_handlerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected