Skip to main content

HTTPS 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 '{"enabled":true,"add":{"Content-Security-Policy":"script-src 'self'","X-Frame-Options":"DENY"}}' \
https://api.ngrok.com/edges/https/edghts_2TMGJZUrl1zZszoqqA4ii6VO4wk/routes/edghtsrt_2TMGJYj6waPFTtCV7rNG9Qh8zNv/response_headers

Parameters

   
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

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

Fields

   
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_2TMGJZUrl1zZszoqqA4ii6VO4wk/routes/edghtsrt_2TMGJYj6waPFTtCV7rNG9Qh8zNv/response_headers

Response

Returns a 200 response on success

Example Response

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

Fields

   
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_2TMGJZUrl1zZszoqqA4ii6VO4wk/routes/edghtsrt_2TMGJYj6waPFTtCV7rNG9Qh8zNv/response_headers

Response

Returns a 204 response with no body on success