Acode icon indicating copy to clipboard operation
Acode copied to clipboard

Wrong HTTP Response Headers from Builtin Server

Open K79SN4 opened this issue 1 year ago • 3 comments

Check for existing issues

  • [X] Completed

Describe the bug / provide steps to reproduce it

Actual behaviour

Builtin server returns duplicated Content-Type and Content-Length headers:

  1. Content-Length is duplicated (e.g. 11743, 11743).
  2. Content-Type is repeated
    • text/plain, text/javascript
    • text/html, text/html

Expected Behavior

  • Content-Length should reflect the accurate response body length.
  • Content-Type should be in the format: type/subtype; parameter* (e.g. text/html; charset=UTF-8), without duplication.

Steps to Reproduce

  1. Open a project folder in Acode.
  2. Launch index.html.
  3. Open a fetch or XMLHttpRequest request ("GET" or "HEAD" method).
  4. Inspect the response headers.

Environment

Device Information: WebView Info: Package Name: com.google.android.webview Version: 131.0.6778.135

App Info: Name: Acode Package Name: com.foxdebug.acodefree Version: 1.10.6 Version Code: 954

Device Info: Android Version: 14 Manufacturer: realme Model: RMX3998 Platform: Android Cordova Version: 13.0.0

Screen Info: Width: 360 Height: 800 Color Depth: 24

Additional Info: Language: en-GB User Agent: Mozilla/5.0 (Linux; Android 14; RMX3998 Build/UP1A.231005.007; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/131.0.6778.135 Mobile Safari/537.36 Texmux Version: googleplay.2024.10.30

If applicable, add mockups / screenshots regarding your vision

No response

If applicable, attach your Acode.log file to this issue.

Acode.log

K79SN4 avatar Jan 07 '25 16:01 K79SN4

It's fine for me, there is no such duplication

bajrangCoder avatar Feb 05 '25 13:02 bajrangCoder

I've reinstalled the app from the PlayStore and even tested it on a different device, but the issue still persists.

Image Console newtork tab showing incorrect response headers

Relavent Files:

  • run.js

    Return value of require('meme-types').lookup isn't checked in sendByExt & sendFile.

  • NanoHTTPDWebserver.java

    Requires some debugging to verify headers.

K79SN4 avatar Feb 06 '25 20:02 K79SN4

Ok got it , it happens when making requests to local files not with the external urls

bajrangCoder avatar Feb 07 '25 03:02 bajrangCoder

Hi there! 👋 We're working to clean up our issue tracker by closing older issues that might not be relevant anymore. If you are able to reproduce this issue in the latest version of Acode, please let us know by commenting on this issue(i.e Bump!), and we will keep it open. If you can't reproduce it, feel free to close the issue yourself. Otherwise, we'll close it in 14 days. Thanks for your help!

github-actions[bot] avatar Jul 13 '25 03:07 github-actions[bot]

Issue not resolved till.

K79SN4 avatar Jul 16 '25 13:07 K79SN4

Hi there! 👋 We're working to clean up our issue tracker by closing older issues that might not be relevant anymore. If you are able to reproduce this issue in the latest version of Acode, please let us know by commenting on this issue(i.e Bump!), and we will keep it open. If you can't reproduce it, feel free to close the issue yourself. Otherwise, we'll close it in 14 days. Thanks for your help!

github-actions[bot] avatar Sep 23 '25 02:09 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Oct 08 '25 02:10 github-actions[bot]