Giter VIP home page Giter VIP logo

engagenet's People

Contributors

andyhitchman avatar fschwiet avatar sburman avatar troygoode avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

engagenet's Issues

TokenUrl issue when running over HTTPS on Chrome

Hi,

I believe I've hit a small issue when running over SSL (this is locally on my development PC, however I suspect it's also an issue on public facing sites).

It's in the EngageUrlBuilder, TokenUrl method where the code is checking for HTTP or HTTPS connections and compares to "ON". I'm using IIS7 which is presenting "on" in the HTTPS header, so it fails due to the case. I've re-worked this locally and tested and the following works:

    public string TokenUrl(string pathAndQuery)
    {
        if (!pathAndQuery.StartsWith("/"))
            pathAndQuery = "/" + pathAndQuery;

        string protocol = _urlHelper.RequestContext.HttpContext.Request.ServerVariables["HTTPS"];
        string host = _urlHelper.RequestContext.HttpContext.Request.ServerVariables["HTTP_HOST"];
        bool isHttps = (string.Compare(protocol, "ON", System.StringComparison.InvariantCultureIgnoreCase) == 0);

        return string.Format(
            "{0}://{1}{2}",
            isHttps ? "https" : "http",
            host,
            VirtualPathUtility.ToAbsolute(pathAndQuery)
            );
    }

Hope this helps.

RPXApiResponseParser throws XML parsing exception

Running on .NET 4.0 in the Dev Web Server (Cassandra) I get the following exception:

Data at the root level is invalid. Line 1, position 1.

Description: An unhandled exception occurred during the execution of the current web request.  Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1.

Source Error: 


Line 12:                throw new RPXException("No response to parse");
Line 13: 
Line 14:            var doc = XDocument.Load(responseReader, LoadOptions.None);
Line 15:            if (doc.Root.Attribute("stat").Value == "ok")
Line 16:                return doc.Root;

Source File: C:\Projects\RPXLib\src\RPXLib\RPXApiResponseParser.cs    Line: 14 

Stack Trace: 


[XmlException: Data at the root level is invalid. Line 1, position 1.]
   System.Xml.XmlTextReaderImpl.Throw(Exception e) +73
   System.Xml.XmlTextReaderImpl.Throw(String res, String arg) +122
   System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace() +4076201
   System.Xml.XmlTextReaderImpl.ParseDocumentContent() +189
   System.Xml.XmlTextReaderImpl.Read() +145
   System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options) +44
   System.Xml.Linq.XDocument.Load(TextReader textReader, LoadOptions options) +63
   RPXLib.RPXApiResponseParser.Parse(TextReader responseReader) in C:\Projects\RPXLib\src\RPXLib\RPXApiResponseParser.cs:14
<...snip...>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.