Forum Discussion

zipperbox_11405's avatar
zipperbox_11405
Icon for Nimbostratus rankNimbostratus
Apr 08, 2013

http request stream rewriting

Server Application: Saba LMS

 

Problem Description: When using the Saba Learning Management System through an F5 with significantly different URLs internally and externally, we are faced with a problem when the user launches learning content. The scorm_launch api sends a string back to the server and we are unable to modify the URLs in the string so the internal server receives external URLs in the command string as seen below. Otherwise everything operates properly with our existing irules and stream. We are able to modify the http::headers and http::response as required but incoming strings remain untouched.

 

http profile:

 

Response Chunking: Rechunk

 

OneConnect Transformations: enabled

 

Redirect Rewrite: All

 

SSL Profile (Client): using server cert

 

Stream Profile (Target): @dev1.afiile.ca@external_url/rcs1@ @content.afiile.ca@external_url/rcs2@ @saba.afiile.ca@external_url@ @outstart.afiile.ca@external_url@ @external_url:80@external_url@ @external_url/rcs2@content.afiile.ca@ @external_url@saba.afiile.ca@

 

iRule:

 

when HTTP_REQUEST { HTTP::header insert "X-Forwarded-Proto" "https";

 

switch -glob [string tolower [HTTP::uri]] {

 

"/lcms*" { pool AFIILE-WEB-POOL90}

 

}

 

log local1. "[IP::client_addr]:[TCP::client_port]: pool info: [LB::server]"

 

set LogString "src:[IP::client_addr]:[TCP::client_port]-> dst:[HTTP::host][HTTP::uri], request type:[HTTP::method], http version:[HTTP::version] pool info: [LB::server]"

 

log local1. "$LogString (request)"

 

foreach aHeader [HTTP::header names] {

 

log local1. "$aHeader: [HTTP::header value $aHeader]"

 

}

 

}

 

when HTTP_RESPONSE {

 

log local1. "$LogString (response) - status: [HTTP::status], Response Size: [HTTP::payload length]"

 

foreach aHeader [HTTP::header names] {

 

if { [HTTP::is_redirect] } {

 

HTTP::header replace Location "[string map -nocase [list https%3A%2F%2Fexternal_url%3A80 https%3A%2F%2Fexternal_url http%3A%2F%2Fcontent.afiile.ca https%3A%2F%2Fexternal_url%2Frcs2 http%3A%2F%2Fsaba.afiile.ca https%3A%2F%2Fexternal_url http%3A%2F%2Fdev1.afiile.ca https%3A%2F%2Fexternal_url%2Frcs1 http%3A%2F%2Foutstart.afiile.ca https%3A%2F%2Fexternal_url] [HTTP::header value Location]]"

 

HTTP::header replace Location "[string map -nocase [list http%3A%2F%2Fdev1.afiile.ca http%3A%2F%2Fexternal_url] [HTTP::header value Location]]"

 

log local1. "$aHeader: [HTTP::header value $aHeader]"

 

}

 

}

 

}

 

Capture:

 

GET /rcs2/scorm_launch/remote_frameset.jsp?content_controller_url=https%3A%2F%2Fexternal_url%2FSaba%2FWeb_wdk%2FAFIILE%2Fcontent%2Fplayers%2FSequencedPlayerNavigator.rdf&callback_url=https%3A%2F%2Fexternal_url%2FSaba%2FAICCReporter%3FscormSessionKey%3D41DD66C0109D8B68C76C920B0C5E5DF4%26sitename%3DSabaSite%26lms_data%3D%25253BconformanceLevel%25253D0%26cmi_entry%3Daireg000000000006563aises000000000002526&content_server_url=https%3A%2F%2Fexternal_url%2Frcs2&sco_url=https%3A%2F%2Fexternal_url%2Frcs2%2Fproduction-remote%2Fcninv000000000001128%2FcommentsFromLearnerComment%2Fmain.htm&mode=online&check_scorm_compliance=false&charset=UTF-8&debug=false&scorm_version=null&player_version=2&activity_id=A19a&context_id=ctctx000000000001833&subscription_id=ctnsr000000000001460&content_server_id=media000000000001003&content_inventory_id=cninv000000000001128&isContentComplianceTestMode=false&cmiEntryId=aireg000000000006563aises000000000002526&contentFormatVersion=1.3.1 HTTP/1.1

 

What It Should Be:

 

GET /scorm_launch/remote_frameset.jsp?content_controller_url=https%3A%2F%2Finternal_url%2FSaba%2FWeb_wdk%2FAFIILE%2Fcontent%2Fplayers%2FSequencedPlayerNavigator.rdf&callback_url=https%3A%2F%2Finternal_url%2FSaba%2FAICCReporter%3FscormSessionKey%3D41DD66C0109D8B68C76C920B0C5E5DF4%26sitename%3DSabaSite%26lms_data%3D%25253BconformanceLevel%25253D0%26cmi_entry%3Daireg000000000006563aises000000000002526&content_server_url=https%3A%2F%2Finternal_url%2Frcs2&sco_url=https%3A%2F%2Finternal_url%2Frcs2%2Fproduction-remote%2Fcninv000000000001128%2FcommentsFromLearnerComment%2Fmain.htm&mode=online&check_scorm_compliance=false&charset=UTF-8&debug=false&scorm_version=null&player_version=2&activity_id=A19a&context_id=ctctx000000000001833&subscription_id=ctnsr000000000001460&content_server_id=media000000000001003&content_inventory_id=cninv000000000001128&isContentComplianceTestMode=false&cmiEntryId=aireg000000000006563aises000000000002526&contentFormatVersion=1.3.1 HTTP/1.1

 

 

2 Replies

  • If the find/replace strings are different length I think you'll need to collect the request payload with HTTP::collect and then rewrite the content in HTTP_REQUEST_DATA. The stream profile doesn't have a way to update the content-length header. A stream profile works for response content when you have TMM rechunk it.

     

     

    Aaron
  • Thanks for the input. We are relatively new at this still. Can you explain how to "you'll need to collect the request payload with HTTP::collect and then rewrite the content in HTTP_REQUEST_DATA".

     

     

    Outgoing packets are being manipulated okay, but as you can see from the capture sample above the inbound packets are not being manipulated to change the external URLs back to internal URLs. Any help would be much appreciated!