Navigation Menu

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

WARequest >> #rawBody is empty #648

Closed
GoogleCodeExporter opened this issue Mar 25, 2015 · 5 comments
Closed

WARequest >> #rawBody is empty #648

GoogleCodeExporter opened this issue Mar 25, 2015 · 5 comments

Comments

@GoogleCodeExporter
Copy link

WARequest >> #rawBody is empty on a POST request on Kom when the content-type 
is not application/x-www-form-urlencoded. 

Original issue reported on code.google.com by philippe...@gmail.com on 6 Apr 2011 at 10:16

@GoogleCodeExporter
Copy link
Author

The problem is in HttpRequest >> #rawPostFields

Original comment by philippe...@gmail.com on 6 Apr 2011 at 10:18

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

I have tested the following modification:

HttpRequest>>#rawPostFields
    ^self propertyAt: #rawPostFields ifAbsentPut: [
        (self isPostRequest) ifTrue: [
            stream next: self contentLength
        ] ifFalse: [
            ''
        ].
    ] 

It seems ok.

Original comment by olivier....@gmail.com on 6 Apr 2011 at 12:25

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Name: KomHttpServerLight-pmm.7
Author: pmm
Time: 13 April 2011, 11:15:01 pm
UUID: 540eee5a-7312-45a2-9fb6-f70e0ac9c951
Ancestors: KomHttpServerLight-pmm.6

- Issue 648:    WARequest >> #rawBody is empty
- http://code.google.com/p/seaside/issues/detail?id=648

Name: KomHttpServer-pmm.65
Author: pmm
Time: 13 April 2011, 11:18:19 pm
UUID: 7532dedf-6bf2-4e70-8c3c-9b5ed5011434
Ancestors: KomHttpServer-pmm.64

- Issue 648:    WARequest >> #rawBody is empty
- http://code.google.com/p/seaside/issues/detail?id=648

Original comment by philippe...@gmail.com on 13 Apr 2011 at 7:19

  • Changed state: Fixed
  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

KomHttpServerLight-pmm.7 breaks multipart uploads (reproducible in 
http://localhost:8080/tests/functional/WAInputPostMultipartFunctionalTest). 
Reverted to KomHttpServerLight-pmm.6.

Original comment by renggli on 22 Apr 2011 at 9:06

  • Changed state: New
  • Added labels: Priority-Critical
  • Removed labels: Priority-Medium

@GoogleCodeExporter
Copy link
Author

Wow, good catch, I should have caught this. So interestingly enough the 
multipart decoding in Kom does not use #rawPostFields but instead reads 
directly from the socket. If two methods both want to read the same data from 
the socket, one of them is going to lose.

The original code assumed that there are only two kinds of POSTs, multipart and 
urlencoded. So it checked for content type being urlencoded instead of it being 
not multipart.

With this fix #rawBody is still empty for multipart POSTs which I guess we can 
live with.

Name: KomHttpServerLight-pmm.8
Author: pmm
Time: 22 April 2011, 11:00:33 pm
UUID: 08d0af0c-d1a0-4d59-8f79-1489553f821d
Ancestors: KomHttpServerLight-pmm.7

- http://code.google.com/p/seaside/issues/detail?id=648

Name: KomHttpServer-pmm.66
Author: pmm
Time: 22 April 2011, 11:07:29 pm
UUID: 0e6cc59c-e43a-4b64-883e-5fcf274c2841
Ancestors: KomHttpServer-pmm.65

- http://code.google.com/p/seaside/issues/detail?id=648
- Issue 648:    WARequest >> #rawBody is empty 
- fix multipart posts
- Issue 648:    WARequest >> #rawBody is empty 
- fix multipart posts

Original comment by philippe...@gmail.com on 22 Apr 2011 at 9:14

  • Changed state: Fixed
  • Added labels: ****
  • Removed labels: ****

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

No branches or pull requests

1 participant