Skip to content
This repository has been archived by the owner on Oct 17, 2024. It is now read-only.

Commit

Permalink
Fix to handle query string
Browse files Browse the repository at this point in the history
  • Loading branch information
Rathna Natarajan committed Jul 3, 2019
1 parent f4c119a commit 9d49c8a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion param.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"apiname": "pcftest",
"type":"swagger",
"uri": "http://greeting-app-interested-fossa.apps.sanpablo.cf-app.com/api/v3/swagger.json"
"uri": "http://greeting-app-talkative-squirrel.apps.tokyo.cf-app.com/api/v3/swagger.json"
}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
034f4708296332260654ba2407d10019
5c00d816d985ea7c7edd5fccdcc5ea26
Original file line number Diff line number Diff line change
Expand Up @@ -7704,6 +7704,10 @@
<fval name="extension"><value>.jar</value></fval>
<fval name="mimeType"><value>application/x-java-archive</value></fval>
</entity>
<entity xmlns="http://www.vordel.com/2005/06/24/entityStore" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" type="MimeType" entityPK="3917188602117604194" parentPK="-8492238750300463192">
<fval name="extension"><value></value></fval>
<fval name="mimeType"><value>*/*</value></fval>
</entity>
<entity xmlns="http://www.vordel.com/2005/06/24/entityStore" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" type="MimeType" entityPK="3945297027673230918" parentPK="-8492238750300463192">
<fval name="extension"><value>.pdf</value></fval>
<fval name="mimeType"><value>application/pdf</value></fval>
Expand Down Expand Up @@ -13270,7 +13274,7 @@
<fval name="logSuccess"><value>Passed script filter</value></fval>
<fval name="name"><value>Get Path from X-Cf-Forwarded-Url</value></fval>
<fval name="requiredProperties"></fval>
<fval name="script"><value>import java.net.URI;&#xD;&#xA;&#xD;&#xA;def invoke(msg) &#xD;&#xA;{&#xD;&#xA; def url = msg.get(&quot;url&quot;); &#xD;&#xA; def URI = new URI(url);&#xD;&#xA; def path = URI.getRawPath();&#xD;&#xA; msg.put(&quot;path&quot;,path);&#xD;&#xA; def httpHeaders = msg.get(&quot;http.headers&quot;);&#xD;&#xA; def port = URI.getPort();&#xD;&#xA; if ( port == -1) {&#xD;&#xA;&#x9; httpHeaders.setHeader(&quot;Host&quot;, URI.getHost());&#xD;&#xA; } else{&#xD;&#xA; httpHeaders.setHeader(&quot;Host&quot;, URI.getHost() + &quot;:&quot; + port);&#xD;&#xA; }&#xD;&#xA; return true; &#xD;&#xA;}</value></fval>
<fval name="script"><value>import java.net.URI;&#xD;&#xA;&#xD;&#xA;def invoke(msg) &#xD;&#xA;{&#xD;&#xA; def url = msg.get(&quot;url&quot;); &#xD;&#xA; def URI = new URI(url);&#xD;&#xA; def path = URI.getRawPath();&#xD;&#xA; def queryString = URI.getRawQuery();&#xD;&#xA; path = path + (queryString == null ? &quot;&quot; : &apos;?&apos; + queryString);&#xD;&#xA; msg.put(&quot;path&quot;,path);&#xD;&#xA; def httpHeaders = msg.get(&quot;http.headers&quot;);&#xD;&#xA; def port = URI.getPort();&#xD;&#xA; if ( port == -1) {&#xD;&#xA;&#x9; httpHeaders.setHeader(&quot;Host&quot;, URI.getHost());&#xD;&#xA; } else{&#xD;&#xA; httpHeaders.setHeader(&quot;Host&quot;, URI.getHost() + &quot;:&quot; + port);&#xD;&#xA; }&#xD;&#xA; return true; &#xD;&#xA;}</value></fval>
<fval name="successNode"><value contentType="reference">2331372335669071159</value></fval>
</entity>
<entity xmlns="http://www.vordel.com/2005/06/24/entityStore" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" type="AttributeExtractHTTPHeaderFilter" entityPK="8895625963261121359" parentPK="361572352584357271">
Expand Down

0 comments on commit 9d49c8a

Please sign in to comment.