Code Monkey home page Code Monkey logo

premotion-aspnet-appharbor-integration's People

Contributors

dazbradbury avatar devatwork avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

premotion-aspnet-appharbor-integration's Issues

Module breaks use of Request.IsAjax()

As per this discussion on SO:

http://stackoverflow.com/questions/11944236/port-number-in-appharbor-url-causes-page-content-not-to-load/11944717#comment15933582_11944717

It would seem by overwriting the native Init() method, certain helper flags aren't set. One of those certainly appears to be for IsAjax Request. I'm not sure what others could be getting masked, but it's something to be aware of when using the library.

Might be worth comparing to the native method from the MVC.

Also - by only having the library work when on AppHarbor, it makes debugging quite confusing. Is there a real reason to have that as a condition?

Support for other framework versions

Currently there is an hardcoded reference to System.Web.HttpServerVarsCollection, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a. This wont work with other framework versions.

Remove the physical IP from the X-Forwarded-For header

You should remove the AppHarbor IP from the X-Forwarded-For header so that it properly reflects the incoming request.
Otherwise, the physical outward-facing IP address shows up twice - in the remote address and in XFF.

if (forwardSeparatorIndex < 0) {
    serverVariables.Set("REMOTE_ADDR", forwardedFor);
    serverVariables.Remove(ForwardedForHeaderName);
} else {
    serverVariables.Set("REMOTE_ADDR", forwardedFor.Remove(forwardSeparatorIndex));
    serverVariables.Set(ForwardedForHeaderName, forwardedFor.Substring(forwardSeparatorIndex + ForwardedForAddressesSeparator.Length));
}

Occasional unhandled exception on AppHarbor

I'm occasionally getting this exception in my AppHarbor site:
[InvalidOperationException: The behavior of the AppHarbor loadbalancer changed, it no longer specifies the HTTP_X_FORWARDED_FOR header]
at Premotion.AspNet.AppHarbor.Integration.AppHarborModule.<>c__DisplayClass1.b__0(Object sender, EventArgs args) in C:\inetpub\wwwroot\PremotionAspNetAppHarborIntegration\src\Premotion.AspNet.AppHarbor.Integration\AppHarborIntegrationModule.cs:line 89
at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Forms Auth Breaks

I get the following error when loading my login page:

System.NotSupportedException: Collection is read-only.
   at System.Collections.Specialized.NameObjectCollectionBase.BaseSet(String name, Object value)
   at System.Web.HttpServerVarsCollection.SetServerVariableManagedOnly(String name, String value)
   at System.Web.HttpServerVarsCollection.SetNoDemand(String name, String value)
   at System.Web.HttpRequest.SetSkipAuthorization(Boolean value)
   at System.Web.HttpContext.SetSkipAuthorizationNoDemand(Boolean value, Boolean managedOnly)
   at System.Web.Security.FormsAuthenticationModule.OnEnter(Object source, EventArgs eventArgs)
   at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

The problem is that you make the ServerVariables collection read-only even if it didn't used to be.
I broke out the source and fixed it myself (and greatly simplified the code) at https://gist.github.com/2025391

Sorry for the non-pull-request; I was in a hurry

[Bug?] Headers lost

It appears I am losing headers now that I am using this...

X-NuGet-ApiKey: thekey <- I replaced the actual guid with thekey in this issue report only. The actual request makes use of a real key.

Request:

PUT http://chocotest.apphb.com/api/v2/package/ HTTP/1.0
User-Agent: NuGet Command Line/1.6.21205.9031 (Microsoft Windows NT 6.1.7601 Service Pack 1)
X-NuGet-ApiKey: thekey
Content-Type: multipart/form-data; boundary=---------------------------8cf71b7537342b2
Host: chocotest.apphb.com
Content-Length: 3723

I left out the rest of the request

Response:

HTTP/1.1 400 The API key '' is invalid. <- It looks like it is losing the key that is passed to it in the headers

HTTP/1.1 400 The API key '' is invalid.
Server: nginx
Date: Sat, 06 Oct 2012 13:54:58 GMT
Content-Type: text/html
Connection: close
Cache-Control: private
Content-Length: 11

Bad Request

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.