【问题标题】:Querystring causes IE to show error查询字符串导致 IE 显示错误
【发布时间】:2010-03-17 18:15:57
【问题描述】:

当我将 IE 发送到以下位置时遇到问题:http://fdvweb.mal/db/historikk/db_historikk_liste.asp?SQLfilter=SELECT TaKompHistorikk.*, TaKomponent.KompNummer, TaKomponent.KompNavn, TaKomponent.KompPlassering FROM TaKomponent RIGHT OUTER JOIN TaKompHistorikk ON [TaKomponent].[KompId]=[TaKompHistorikk].[KompHistorikkKompId] WHERE KompHistorikkSak = 'Servicerapport' AND (KompHistorikkStatusnummer <> '9999' OR IsNull(KompHistorikkStatusnummer) ) AND ((KompHistorikkStatusNavn <> 'OK' OR IsNull(KompHistorikkStatusNavn) ) OR ((KompHistorikkTittel <> '' OR KompHistorikkFritekst <> '') AND KompHistorikkTittel <> 'Kontrollert OK')) AND KompHistorikkDato >%3D %232/17/2010%23 ORDER BY KompNummer ASC(本地主机,我已经编辑了主机文件)。文件db_historik_liste.asp的源代码如下:

<html>
   <head>
      <title>Test</title>
   </head>
   <body>
      <% Response.Write Request.QueryString("SQLfilter") %>
   </body>
</html>

但是,IE 给了我错误Internet Explorer has modified this page to help prevent cross-site scripting.

有人知道我可以如何防止这种情况发生吗?

【问题讨论】:

    标签: internet-explorer query-string


    【解决方案1】:

    尝试将查询字符串部分包装在 HttpUtility.UrlEncode() 中

    【讨论】:

    • 你的意思是像&lt;% Response.Write HttpUtility.UrlEncode(Request.QueryString("SQLfilter")) %&gt;
    【解决方案2】:

    解决方法是设置标题X-XSS-Protection: 0

    【讨论】:

      【解决方案3】:
      require('es6-promise').polyfill();
      require('isomorphic-fetch');
      
      fetch('//offline-news-api.herokuapp.com/stories')
          .then(function(response) {
              if (response.status >= 400) {
                  throw new Error("Bad response from server");
              }
              return response.json();
          })
          .then(function(stories) {
              console.log(stories);
          });
      

      【讨论】:

        猜你喜欢
        • 2015-02-16
        • 1970-01-01
        • 2016-07-26
        • 1970-01-01
        • 1970-01-01
        • 2017-08-21
        • 2019-08-04
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多