cfug / cfug/dio

Missing Content-Lenght header (HTTP2Adapter on a HTTP 1/1 connection)

Open
#2,382 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

h: need more info h: need triage s: bug
Dominant language
Dart
Stars
12.8k
Forks
1.6k
PR merge metrics
No merged PRs in 30d

Description

Package

http2_adapter

Version

2.6.0

Operating-System

Android

Adapter

Http2Adapter

Output of flutter doctor -v
[✓] Flutter (Channel stable, 3.24.4, on macOS 15.3 24D60 darwin-arm64, locale fr-FR)
    • Flutter version 3.24.4 on channel stable at ~/fvm/versions/3.24.4
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 603104015d (4 months ago), 2024-10-24 08:01:25 -0700
    • Engine revision db49896cf2
    • Dart version 3.5.4
    • DevTools version 2.37.3

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.1)
    • Android SDK at ~/Library/Android/sdk
    • Platform android-35, build-tools 35.0.1
    • ANDROID_HOME = ~/Library/Android/sdk
    • Java binary at: /Library/Java/JavaVirtualMachines/amazon-corretto-17.jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment Corretto-17.0.9.8.1 (build 17.0.9+8-LTS)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 16.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 16C5032a
    • CocoaPods version 1.15.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2024.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 21.0.3+-79915917-b509.11)

[✓] IntelliJ IDEA Ultimate Edition (version 2024.3.3)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin version 83.0.4
    • Dart plugin version 243.23177

[✓] IntelliJ IDEA Ultimate Edition (version 2024.3.1)
    • IntelliJ at ~/Applications/IntelliJ IDEA Ultimate.app
    • Flutter plugin version 83.0.4
    • Dart plugin version 243.23177

[✓] VS Code (version 1.97.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.104.0
Dart Version

3.5.4

Steps to Reproduce
  • perform a GET request using HTTP2Adapter on a HTTP 1/1 only backend
  • repeat previous step many times (how many can vary: maybe 5, maybe 10) and maybe quickly - not sure exactly for the details
  • trace the HTTP requests
Expected Result

all requests must have the Content-Length HTTP header (required on HTTP 1/1, optional only on HTTP 2/0)

Actual Result

Most of the requests do have the Content-Length header but some others don't

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 with the Http2Adapter request path and reproduce repeated GET requests against an HTTP/1.1-only backend while tracing the requests. Compare requests that include Content-Length with those that do not; done means every request sent over the HTTP/1.1 connection includes that header.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.