OpenFeign / OpenFeign/feign

Response.InputStreamBody's toString method closes input stream.

Open
#1,208 2 comments 14 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

proposal
Dominant language
Java
Stars
9.8k
Forks
1.9k
Avg merge
1d 2h
Merged PRs (30d)
41

Description

The toString() on Response.InputStreamBody causes the underlying inputstream to be closed.
https://github.com/OpenFeign/feign/commit/0a0ff3f192c3ae8325b6421763e92cb9343c5334

When using IntellJ the default behavior while debugging is to call any toString methods that have been overridden.
image

You can disable this functionality but it would be nice if the toString method just returned a copy of the data.

I have opened a ticket with IntelliJ to allow an 'excludes' list.
https://youtrack.jetbrains.com/issue/IDEA-237009

Thoughts?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at Response.InputStreamBody.toString(), the entry point named in the issue, and inspect how it reads and closes the underlying input stream. Reproduce the debugger-triggered call, then verify that toString returns a copy of the data without closing the stream and add or update a regression test for that behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.