Skip to content

Add EmptyHttpRequest Indexer #132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Griddly.Mvc/NetFramework/GriddlySettingsResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public override object GetService(Type serviceType)

class EmptyHttpRequest : HttpRequestBase
{
public EmptyHttpRequest (HttpRequestBase originalRequest)
public EmptyHttpRequest(HttpRequestBase originalRequest)
{
_originalRequest = originalRequest;
}
Expand Down Expand Up @@ -172,6 +172,7 @@ public EmptyHttpRequest (HttpRequestBase originalRequest)
public override string ContentType { get { return _originalRequest.ContentType; } set { } }
public override System.Text.Encoding ContentEncoding { get { return _originalRequest.ContentEncoding; } set { } }
public override RequestContext RequestContext { get; set; }
public override string this[string key] => QueryString[key] ?? Form[key] ?? Cookies[key]?.Value ?? ServerVariables[key];

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or you could also

Suggested change
public override string this[string key] => QueryString[key] ?? Form[key] ?? Cookies[key]?.Value ?? ServerVariables[key];
public override string this[string key] => _originalRequest[key];

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but I am not sure if/what EMPTYHttpRequest should return in the first place... I just don't want it to throw

}

class EmptyHttpResponse : HttpResponseBase
Expand Down