Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong HTTP Response Headers from Builtin Server #1137

Open
1 task done
K79SN4 opened this issue Jan 7, 2025 · 3 comments
Open
1 task done

Wrong HTTP Response Headers from Builtin Server #1137

K79SN4 opened this issue Jan 7, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@K79SN4
Copy link

K79SN4 commented Jan 7, 2025

Check for existing issues

  • 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
@bajrangCoder
Copy link
Collaborator

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

@K79SN4
Copy link
Author

K79SN4 commented Feb 6, 2025

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.

@bajrangCoder
Copy link
Collaborator

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

@bajrangCoder bajrangCoder added the bug Something isn't working label Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants