(reason, message, url, context, extra = {})
| 220 | } |
| 221 | |
| 222 | function createPolicyError(reason, message, url, context, extra = {}) { |
| 223 | incrementSecurityCounter("ssrf_blocked_total"); |
| 224 | if (reason === "metadata_endpoint") { |
| 225 | incrementSecurityCounter("metadata_blocked_total"); |
| 226 | } |
| 227 | |
| 228 | logOutboundSecurityEvent( |
| 229 | createPolicyLogPayload(url, context, reason, extra) |
| 230 | ); |
| 231 | |
| 232 | return new OutboundPolicyError(reason, message, extra); |
| 233 | } |
| 234 | |
| 235 | function resolveAllowPrivateHost(context = {}) { |
| 236 | if (typeof context.allowPrivateHost === "boolean") { |
no test coverage detected