(ctx context.Context, request *http.Request, trackVarsArray *C.zval)
| 158 | } |
| 159 | |
| 160 | func addHeadersToServer(ctx context.Context, request *http.Request, trackVarsArray *C.zval) { |
| 161 | for field, val := range request.Header { |
| 162 | if k := commonHeaders[field]; k != nil { |
| 163 | v := strings.Join(val, ", ") |
| 164 | C.frankenphp_register_known_variable(k, toUnsafeChar(v), C.size_t(len(v)), trackVarsArray) |
| 165 | continue |
| 166 | } |
| 167 | |
| 168 | // if the header name could not be cached, it needs to be registered safely |
| 169 | // this is more inefficient but allows additional sanitizing by PHP |
| 170 | k := phpheaders.GetUnCommonHeader(ctx, field) |
| 171 | v := strings.Join(val, ", ") |
| 172 | C.frankenphp_register_variable_safe(toUnsafeChar(k), toUnsafeChar(v), C.size_t(len(v)), trackVarsArray) |
| 173 | } |
| 174 | } |
| 175 | |
| 176 | func addPreparedEnvToServer(fc *frankenPHPContext, trackVarsArray *C.zval) { |
| 177 | for k, v := range fc.env { |
no test coverage detected