Nancy: AsString extension no longer works

Created on 2 Feb 2017  Â·  9Comments  Â·  Source: NancyFx/Nancy

Prerequisites

  • [x] I have written a descriptive issue title
  • [x] I have verified that I am running the latest version of Nancy
  • [x] I have verified if the problem exist in both DEBUG and RELEASE mode
  • [x] I have searched open and closed issues to ensure it has not already been reported

Description

We recently moved the Request.Body to a Stream away from a RequestStream. We have an extension that allows you to get a request body as string however its an extension method off of RequestStream.

Steps to Reproduce

To get this to work you have to do ((RequestStream)this.Body)>AsString() which is nasty.

This needs fixing https://github.com/NancyFx/Nancy/blob/be4f8d42076e4e568a3742715437868e6c7d05af/src/Nancy/Extensions/RequestStreamExtensions.cs#L18

I think this test needs ammending https://github.com/NancyFx/Nancy/blob/be4f8d42076e4e568a3742715437868e6c7d05af/test/Nancy.Tests/Unit/Extensions/RequestStreamExtensionsFixture.cs

System Configuration

  • Nancy version: 2.0-clinteastwood
  • Nancy host

    • [ ] ASP.NET

    • [ ] OWIN

    • [ ] Self-Hosted

    • [x] Other: Kestrel

  • Other Nancy packages and versions:
  • Environment (Operating system, version and so on): OSX but will apply to all
  • .NET Framework version:
  • Additional information:
Up for Grabs Improvement

Most helpful comment

Wouldn't it be quicker to send a PR than to write an issue and link stuff?

Not to mention it's always nice having PRs like this up for grabs for first timers :)

All 9 comments

So it should be an extension method on Stream instead, is that way you are saying?

Yup

On 2 February 2017 at 09:45, Andreas HÃ¥kansson notifications@github.com
wrote:

So it should be an extension method on Stream instead, is that way you
are saying?

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/NancyFx/Nancy/issues/2698#issuecomment-276911614, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAGapv0t5LUUld6nY8OTPMpmlkL_nGkUks5rYaWogaJpZM4L049J
.

Wouldn't it be quicker to send a PR than to write an issue and link stuff? 🤣

Probably but busy and dont want to forget :)

On 2 February 2017 at 12:07, Andreas HÃ¥kansson notifications@github.com
wrote:

Wouldn't it be quicker to send a PR than to write an issue and link stuff?
🤣

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/NancyFx/Nancy/issues/2698#issuecomment-276940607, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAGapgpqrQLA5OdN2U1LuVLLlMRQjjUPks5rYccNgaJpZM4L049J
.

Wouldn't it be quicker to send a PR than to write an issue and link stuff?

Not to mention it's always nice having PRs like this up for grabs for first timers :)

Make it so...

Wouldn't it be quicker to send a PR than to write an issue and link stuff?

Yes, it is faster to fix it yourself, but that removes opportunities for newbies to open-source or even seasoned vets (who are looking for suggestions of value) to get involved with the project. Check out @yourfirstpr - https://yourfirstpr.github.io/ for more information. Without new blood; projects atrophy.

I can do that

Apologies there was a typo in PR title, too long on the front of PC :( it has been renamed

Was this page helpful?
0 / 5 - 0 ratings