| Both sides previous revision Previous revision Next revision | Previous revision |
| vendors:cisco:uc:ece [2025/06/26 16:25] – [X-Frame-Options and Content-Security-Policy HTTP Response Headers] gerardorourke | vendors:cisco:uc:ece [2026/10/06 15:22] (current) – [ECE] gerardorourke |
|---|
| * [[vendors:cisco:uc:ece:apiexample|Chat using CCE and ECE APIs]] | * [[vendors:cisco:uc:ece:apiexample|Chat using CCE and ECE APIs]] |
| * [[https://developer.cisco.com/docs/enterprise-chat-and-email/#!interaction-api-developer-guide|ECE Interaction APIs Docs]] | * [[https://developer.cisco.com/docs/enterprise-chat-and-email/#!interaction-api-developer-guide|ECE Interaction APIs Docs]] |
| | * [[vendors:cisco:uc:ece:finesse-headless-gadget|ECE Finesse Headless Gadget]] |
| * [[vendors:cisco:uc:ece:interactive-api-examples|ECE Interaction APIs - examples]] | * [[vendors:cisco:uc:ece:interactive-api-examples|ECE Interaction APIs - examples]] |
| * [[vendors:cisco:uc:ece:interactive-api-examples|ECE Interaction APIs - examples]] | * [[vendors:cisco:uc:ece:interactive-api-examples|ECE Interaction APIs - examples]] |
| * [[vendors:cisco:uc:ece:chat-tips|Chat Tips]] | * [[vendors:cisco:uc:ece:chat-tips|Chat Tips]] |
| * [[vendors:cisco:uc:ece:gdprutility|GDPR Utility]] | * [[vendors:cisco:uc:ece:gdprutility|GDPR Utility]] |
| | * [[vendors:cisco:uc:ece:undispatched-activities|Handling Undispatched Activities - by Stanislav Matejovsky]] |
| |
| |
| Find: <code>"wsname=((http[s]?)(:|%3A)(/|%2F)(/|%2F)([_0-9a-z-.@:%_\+~#=]*))"</code> | Find: <code>"wsname=((http[s]?)(:|%3A)(/|%2F)(/|%2F)([_0-9a-z-.@:%_\+~#=]*))"</code> |
| Replace: <code>"wsname=((http[s]?)(:|%3A)(/|%2F)(/|%2F)([a-z0-9-]+[.])*(sub.domain1\.com|domain2\.com)(&|%26|$))"</code> | Replace: <code>"wsname=((http[s]?)(:|%3A)(/|%2F)(/|%2F)([a-z0-9-]+[.])*(sub.domain1\.com|domain2\.com)(&|%26|$))"</code> |
| | |
| | The above issues - the below should allow empty domains .... |
| | <code> |
| | <add input="{QUERY_STRING}" pattern="wsname=((http[s]?)(:|%3A)(/|%2F)(/|%2F)([a-z0-9-]+\.)*(domain1\.com|domain2\.com)(&|%26|$))" /> |
| | </code> |
| |
| \\ | \\ |
| </rule> | </rule> |
| </code> | </code> |
| |
| Instead of above - we can add in the <conditions> the following: | |
| <code><add input="{C:6}" pattern="(^|.*\.)domain1\.com$|(^|.*\.)domain2\.com$" /></code> | |
| |
| |
| This is nicer - but let us test! | |
| |
| Full example of one of the rules (CSP) | |
| This would mean no changes of the rewrite rule and we don't change the wsname part either. | |
| |
| <code> | <code> |
| <rule name="CSP-wsname"> | <rule name="CSP-wsname"> |
| <match serverVariable="RESPONSE_Content_Security_Policy" pattern=".+" negate="true" /> | <match serverVariable="RESPONSE_Content_Security_Policy" pattern=".+" negate="true" /> |
| <conditions logicalGrouping="MatchAll" trackAllCaptures="true"> | <conditions logicalGrouping="MatchAll" trackAllCaptures="true"> |
| <add input="{QUERY_STRING}" pattern="wsname=((http[s]?)(:|%3A)(/|%2F)(/|%2F)([_0-9a-z-.@:%_\+~#=]*))" /> | <!-- One step: extract domain and validate --> |
| <add input="{UNENCODED_URL}" pattern="/(?:web/apps|web/integration/view/platform/common/login|templates/selfservice|templates/finesse/gadget|web/view/platform/common/login|web/controller|templates/chat|web/view/live/customer)/" /> | <add input="{QUERY_STRING}" |
| <add input="{C:6}" pattern="(^|.*\.)domain1\.com$|(^|.*\.)domain2\.com$" /> | pattern="wsname=((http[s]?)(:|%3A)((/|%2F)(/|%2F))(([^&/]+)\.(mydomain1\.com|mydomain2\.com)))" /> |
| </conditions> | |
| <action type="Rewrite" value="frame-ancestors 'self' {C:2}://{UrlDecode:{C:6}}" replace="true" /> | <!-- Check for the correct page path --> |
| </rule> | <add input="{UNENCODED_URL}" |
| | pattern="/(?:web/apps|web/integration/view/platform/common/login|templates/selfservice|templates/finesse/gadget|web/view/platform/common/login|web/controller|templates/chat|web/view/live/customer)/" /> |
| | </conditions> |
| | <!-- Use captured protocol and domain --> |
| | <action type="Rewrite" |
| | value="frame-ancestors 'self' {C:2}://{UrlDecode:{C:5}}" |
| | replace="true" /> |
| | </rule> |
| </code> | </code> |
| | |
| |
| |