GithubHelp home page GithubHelp logo

Comments (9)

b95505017 avatar b95505017 commented on April 28, 2024

I changed StethoInterceptor code these lines, then those responses appear into network tab successfully.

try {
    response = chain.proceed(request);
    if (response.body().contentType() == null) {
        response = response.newBuilder().header("Content-Type", "text/html").build();
    }
} catch (IOException e) {
    if (mEventReporter.isEnabled()) {
        mEventReporter.httpExchangeFailed(requestId, e.toString());
    }
    throw e;
}

from stetho.

jasta avatar jasta commented on April 28, 2024

Thanks that's really helpful. I'll fix this at a lower level so the fix works for stetho-urlconnection too.

from stetho.

b95505017 avatar b95505017 commented on April 28, 2024

Thanks, looking forward to the next release!
Great library!

from stetho.

longinoa avatar longinoa commented on April 28, 2024

Is the right course of action to assume text/html though? spec seems to indicate it should be application/octet-stream http://www.w3.org/Protocols/rfc2616/rfc2616-sec7.html

from stetho.

jasta avatar jasta commented on April 28, 2024

@longinoa It's not actually a Content-Type problem, it's DevTools' internal concept of ResourceType. We can convert a lack of Content-Type header to ResourceType.OTHER and it should work fine.

from stetho.

jasta avatar jasta commented on April 28, 2024

mimeType doesn't need to be faked but I do like using application/octet-stream anyway. Just in case the DevTools folks break stuff later :)

from stetho.

b95505017 avatar b95505017 commented on April 28, 2024

Thanks! May I ask when could we get this on Maven?

from stetho.

jasta avatar jasta commented on April 28, 2024

@b95505017 working on getting a release (1.0.1) out the door this week.

from stetho.

b95505017 avatar b95505017 commented on April 28, 2024

πŸ‘

from stetho.

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.