Forum Discussion
Stream Profile is not working with javascript var?
Hi, i want to solve mixed content issue but stream profile is not working with this javascript code , i want to change http:\u002f\u002 to https:// so i created an irule that matches @@http\u002f\u002f@https://@ , but when i saw response on webpage (view page source) , the url is still the same as http\u002f\u002f
<script type="text/javascript">
var _fV4UI=true;var _spPageContextInfo = {webServerRelativeUrl: "\u002f", webAbsoluteUrl: "http:\u002f\u002fworkpoint.com", siteAbsoluteUrl: "http:\u002f\u002fworkpoint.com", serverRequestPath: "\u002f_layouts\u002f15\u002fFormServer.aspx", layoutsUrl: "_layouts\u002f15", webTitle: "My Process", webTemplate: "1", tenantAppVersion: "0", isAppWeb: false, Has2019Era: true, webLogoUrl: "\u002fPortalImages\u002fLogo-W.jpg", webLanguage: 1033, currentLanguage: 1033, currentUICultureName: "en-US", currentCultureName: "en-GB", clientServerTimeDelta: new Date("2023-12-14T11:41:57.2492077Z") - new Date(), updateFormDigestPageLoaded: new Date("2023-12-14T11:41:57.2492077Z"), siteClientTag: "9$$16.0.5173.1000", crossDomainPhotosEnabled:false, webUIVersion:15, webPermMasks:{High:176,Low:138612807}, pagePersonalizationScope:1,userId:401,userLoginName:"", systemUserKey:"S-1-5-21-842925246-606747145-682003330-8418", alertsEnabled:true, siteServerRelativeUrl: "\u002f", allowSilverlightPrompt:'True', isSiteAdmin: false};Flighting.ExpFeatures = [480215056,1880287568,1561350208,302071836,3212816,69472768,4194310,-2113396707,268502022,-872284160,1049232,-2147421952,65536,65536,2097472,917504,-2147474174,1372324107,67108882,0,0,-2147483648,2097152,0,0,32768,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32768];//]]>
</script>
when HTTP_REQUEST {
# Disable the stream filter for all requests
STREAM::disable
}
when HTTP_RESPONSE {
# Check if response type is text, javascript, svg, or other images
# if {[HTTP::header value Content-Type] contains "text" || [HTTP::header value Content-Type] contains "text/javascript" || [HTTP::header value Content-Type] contains "svg" || [HTTP::header value Content-Type] contains "jpeg" || [HTTP::header value Content-Type] contains "png" || [HTTP::header value Content-Type] contains "gif"} {
# Replace http:// with https://
STREAM::expression {@http://@https://@ , @http%3a%2f%2f@https://@ , @http\u002f\u002f@https://@}
# Enable the stream filter for this response only
STREAM::enable
# }
}
How can i solve the stream profile issue?
Is CSP header can help with mixed content issue when it inserted by F5 in reponse to the client or should i change content for any http to https by using stream profile?
do i need custom HTTP rewrite profile profile to rewrite redirects from http to https?
- zamroni777Nacreous
stream profile uses regular expression syntax which ":" , ".", "\" are part of the syntax
https://en.wikipedia.org/wiki/Regular_expression#POSIX_basic_and_extendedtherefore, you need to instead use \x3A, \x2E, \x5C.
for other hexa codes, you can refer to
https://man7.org/linux/man-pages/man7/ascii.7.html Your stream expression is invalid, it takes a tcl list, not a comma separated one.
This is documented here: https://clouddocs.f5.com/api/irules/STREAM__expression.html
- logan92Altocumulus
Thanks , now it works.
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com