snipt

Ctrl+h for KB shortcuts

Text only

Android/Cordova: http requests not working on jarsigned app

1
2
3
4
5
Only works on debug.
http works, https doesn't.

The problem could come from the certificate:
http://stackoverflow.com/questions/20036260/phonegap-android-app-ajax-requests-to-https-fail-with-status-0
https://snipt.net/embed/b57a79b32ec8fc0a20de53764adc8a19/
https://snipt.net/raw/b57a79b32ec8fc0a20de53764adc8a19/
b57a79b32ec8fc0a20de53764adc8a19
text
Text only
5
2016-09-24T11:33:44
True
False
True
Jul 29, 2014 at 11:45 AM
/api/public/snipt/135973/
androidcordova-http-requests-not-working-on-jarsigned-app-50e8fd6a
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a>Only works on debug. </span><span id="L-2"><a name="L-2"></a>http works, https doesn&#39;t. </span><span id="L-3"><a name="L-3"></a> </span><span id="L-4"><a name="L-4"></a>The problem could come from the certificate: </span><span id="L-5"><a name="L-5"></a>http://stackoverflow.com/questions/20036260/phonegap-android-app-ajax-requests-to-https-fail-with-status-0 </span></pre></div> </td></tr></table>
android, certificate, http

Text only

MS Excel http headers

1
2
3
4
5
6
7
// these headers avoid IE problems when using https:
// see http://support.microsoft.com/kb/812935
header("Cache-Control: must-revalidate");
header("Pragma: must-revalidate");

header("Content-type: application/vnd.ms-excel");
header("Content-disposition: attachment; filename=$filename.csv");
https://snipt.net/embed/f79564634f8fe4a61b98006eb540e61d/
https://snipt.net/raw/f79564634f8fe4a61b98006eb540e61d/
f79564634f8fe4a61b98006eb540e61d
text
Text only
7
2016-09-26T01:06:25
True
False
False
Jan 15, 2013 at 02:23 PM
/api/public/snipt/53790/
ms-excel-http-headers
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a> <a href="#L-7">7</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a>// these headers avoid IE problems when using https: </span><span id="L-2"><a name="L-2"></a>// see http://support.microsoft.com/kb/812935 </span><span id="L-3"><a name="L-3"></a>header(&quot;Cache-Control: must-revalidate&quot;); </span><span id="L-4"><a name="L-4"></a>header(&quot;Pragma: must-revalidate&quot;); </span><span id="L-5"><a name="L-5"></a> </span><span id="L-6"><a name="L-6"></a>header(&quot;Content-type: application/vnd.ms-excel&quot;); </span><span id="L-7"><a name="L-7"></a>header(&quot;Content-disposition: attachment; filename=$filename.csv&quot;); </span></pre></div> </td></tr></table>
http

ApacheConf

Virtual Host redirect

1
2
3
4
5
<VirtualHost *>
  ServerName www.example.com
  Redirect 301 / http://example.com/
  # 301 = perm, 302 = temporarily
</VirtualHost>
https://snipt.net/embed/5534d09e510ceea8a1a962d74d24dd01/
https://snipt.net/raw/5534d09e510ceea8a1a962d74d24dd01/
5534d09e510ceea8a1a962d74d24dd01
apacheconf
ApacheConf
5
2016-09-26T00:34:48
True
False
False
/api/public/snipt/37608/
virtual-host-redirect
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="nt">&lt;VirtualHost</span> <span class="s">*</span><span class="nt">&gt;</span> </span><span id="L-2"><a name="L-2"></a> <span class="nb">ServerName</span> www.example.com </span><span id="L-3"><a name="L-3"></a> <span class="nb">Redirect</span> <span class="m">301</span> / http://example.com/ </span><span id="L-4"><a name="L-4"></a> <span class="c"># 301 = perm, 302 = temporarily</span> </span><span id="L-5"><a name="L-5"></a><span class="nt">&lt;/VirtualHost&gt;</span> </span></pre></div> </td></tr></table>
apache, http, redirect
Copyrighted, illegal, or inappropriate content? Email support@snipt.net.