Code Monkey home page Code Monkey logo

Comments (5)

tchak avatar tchak commented on August 15, 2024 2

I just want to mention that we are moving fetch support to Ember Data itself : emberjs/data#5386

from ember-fetch.

nlfurniss avatar nlfurniss commented on August 15, 2024

hey @simonihmig!

Seems like something that should be changed in Mirage. According to httpstatus, A 204 response is terminated by the first empty line after the header fields because it cannot contain a message body.

The logic in ember-fetch assumes that a 204 is being implemented this way

from ember-fetch.

simonihmig avatar simonihmig commented on August 15, 2024

@nlfurniss hey, yes, I should probably create an issue for mirage as well. But I nevertheless think this could maybe be handled a bit better here as well, i.e. ignore any payload in the adapter mixin for a 204 response. Don't you think?

from ember-fetch.

xg-wang avatar xg-wang commented on August 15, 2024

Hi @simonihmig

To be a drop-in replacement, I think this should behave the same way as before, i.e. return undefined (or maybe { data: null } as it was before)!?

But the PR (it's same as now) you linked, the handling is to return { data: null }

if (response.ok && (status === 204 || status === 205 || requestData.method === 'HEAD')) {
    payload = { data: null };
}

Is it the expected output? Or the payload should be an empty string in 204 case?

from ember-fetch.

simonihmig avatar simonihmig commented on August 15, 2024

Closing this, as this has been fixed in Mirage, and the fetch adapter mixin is deprecated anyway.

from ember-fetch.

Related Issues (20)

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.