Skip to main content

Edge Route Response Headers Module

Replace HTTPS Edge Route Response Headers Module

Request

PUT /edges/https/{edge_id}/routes/{id}/response_headers

Example Request

curl \
-X PUT \
-H "Authorization: Bearer {API_KEY}" \
-H "Content-Type: application/json" \
-H "Ngrok-Version: 2" \
-d '{"add":{"Content-Security-Policy":"script-src 'self'","X-Frame-Options":"DENY"},"enabled":true}' \
https://api.ngrok.com/edges/https/edghts_2gsqMZuHTKjXb8vuTUANdenp1JE/routes/edghtsrt_2gsqMaDhLhf0piXO3qgTMflnZSQ/response_headers

Parameters

NameTypeDescription
enabledbooleantrue if the module will be applied to traffic, false to disable. default true if unspecified
addMap<string, string>a map of header key to header value that will be injected into the HTTP Response returned to the HTTP client
removeList<string>a list of header names that will be removed from the HTTP Response returned to the HTTP client

Response

Returns a 200 response on success

Example Response

{
"add": {
"content-security-policy": "script-src 'self'",
"x-frame-options": "DENY"
},
"enabled": true,
"remove": []
}

Fields

NameTypeDescription
enabledbooleantrue if the module will be applied to traffic, false to disable. default true if unspecified
addMap<string, string>a map of header key to header value that will be injected into the HTTP Response returned to the HTTP client
removeList<string>a list of header names that will be removed from the HTTP Response returned to the HTTP client

Get HTTPS Edge Route Response Headers Module

Request

GET /edges/https/{edge_id}/routes/{id}/response_headers

Example Request

curl \
-X GET \
-H "Authorization: Bearer {API_KEY}" \
-H "Ngrok-Version: 2" \
https://api.ngrok.com/edges/https/edghts_2gsqMZuHTKjXb8vuTUANdenp1JE/routes/edghtsrt_2gsqMaDhLhf0piXO3qgTMflnZSQ/response_headers

Response

Returns a 200 response on success

Example Response

{
"add": {
"content-security-policy": "script-src 'self'",
"x-frame-options": "DENY"
},
"enabled": true,
"remove": []
}

Fields

NameTypeDescription
enabledbooleantrue if the module will be applied to traffic, false to disable. default true if unspecified
addMap<string, string>a map of header key to header value that will be injected into the HTTP Response returned to the HTTP client
removeList<string>a list of header names that will be removed from the HTTP Response returned to the HTTP client

Delete HTTPS Edge Route Response Headers Module

Request

DELETE /edges/https/{edge_id}/routes/{id}/response_headers

Example Request

curl \
-X DELETE \
-H "Authorization: Bearer {API_KEY}" \
-H "Ngrok-Version: 2" \
https://api.ngrok.com/edges/https/edghts_2gsqMZuHTKjXb8vuTUANdenp1JE/routes/edghtsrt_2gsqMaDhLhf0piXO3qgTMflnZSQ/response_headers

Response

Returns a 204 response with no body on success