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

readMIMEHeader exception: malformed MIME header line #409

Closed
irustm opened this issue May 16, 2019 · 7 comments · Fixed by #415
Closed

readMIMEHeader exception: malformed MIME header line #409

irustm opened this issue May 16, 2019 · 7 comments · Fixed by #415

Comments

@irustm
Copy link
Contributor

irustm commented May 16, 2019

Host: localhost:8000
Connection: keep-alive
Content-Length: 136
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36
Cache-Control: no-cache
Origin: chrome-extension://fhbjgbiflinjbdggehcddcbncdddomop
Postman-Token: a5b88a02-b7af-2296-42ba-a9c33ed4206f
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryimeZ2Le9LjohiUiG
Accept: */*
Accept-Encoding: gzip, deflate, br
Accept-Language: ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7
Content-Disposition: form-data; name="test"

------WebKitFormBoundaryimeZ2Le9LjohiUiG--
C:/Users/User/AppData/Local/deno/deps/https/raw.githubusercontent.com/denoland/deno_std/master/textproto/mod.ts:86:22
                throw new ProtocolError(`malformed MIME header line: ${str(kv)}`);
                      ^
Uncaught ProtocolError: malformed MIME header line: ------WebKitFormBoundaryimeZ2Le9LjohiUiG--
@zekth
Copy link
Contributor

zekth commented May 16, 2019

Is your cache up to date for deno_std?
Could you run it with --reload ?

@irustm
Copy link
Contributor Author

irustm commented May 16, 2019

Yeah, I've tried the latest version, too.

@irustm
Copy link
Contributor Author

irustm commented May 16, 2019

and

C:/Users/User/AppData/Local/deno/deps/https/raw.githubusercontent.com/denoland/deno_std/master/textproto/mod.ts:88:22
                throw new ProtocolError(`malformed MIME header line: ${str(kv)}`);
                      ^
Uncaught ProtocolError: malformed MIME header line: POST /home/post HTTP/1.1

@runnerSnail
Copy link

Uncaught ProtocolError: malformed MIME header initial line:     "title":"课2程",
    at ProtocolError (file:///Users/waniu/Library/Caches/deno/deps/https/deno.land/std@v0.3.4/textproto/mod.ts:20:5)
    at readMIMEHeader (file:///Users/waniu/Library/Caches/deno/deps/https/deno.land/std@v0.3.4/textproto/mod.ts:79:13)

@runnerSnail
Copy link

I made the same mistake

@ry
Copy link
Member

ry commented May 18, 2019

I'm unable to repeat this error. If you're able to trigger this exception reliably, please copy and paste the exact HTTP request.

You can attempt to put the request into one of these tests:
https://github.com/denoland/deno_std/blob/c2f5a7cf2206a9a476e0e9b116db00ced327f188/textproto/reader_test.ts#L147-L167
and see if you can trigger a failure.

@zekth
Copy link
Contributor

zekth commented May 18, 2019

I can reproduce. Working on it.

@runnerSnail could you run it using the master branch of deno std? in your example it's an old version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants