Forum Discussion

Dave_Hergert's avatar
Dave_Hergert
Icon for Nimbostratus rankNimbostratus
Mar 08, 2016

new lines in iRules

Can you break up iRules with new lines to improve readability? For example, with the HTTP respond, the syntax says you list out the headers after the status code, but is the below allowed so its easier to read?

 

    HTTP::respond 200 
       Access-Control-Allow-Origin $origin_host
       Access-Control-Allow-Credentials "true"
       Access-Control-Expose-Headers "Location, X-metric-lb-rspt, X-metric-ws-rspt, X-metric-wl-rspt, Content-Disposition"
       Access-Control-Allow-Headers "Authorization, X-Requested-With, Origin, Accept, Content-Type, Cache-Control, Cookie, X-DEVICE-TYPE"
       Access-Control-Allow-Method "GET, POST, OPTIONS"
       Access-Control-Max-Age "1800"
       Timing-Allow-Origin $origin_host
   return