MasoniteFramework / masonite

The Modern And Developer Centric Python Web Framework. Be sure to read the documentation and join the Discord channel for questions: https://discord.gg/TwKeFahmPZ
http://docs.masoniteproject.com
MIT License
2.19k stars 128 forks source link

Content-Type : text/* not supported #809

Open bikash-kodiary opened 3 months ago

bikash-kodiary commented 3 months ago

Describe the bug

While using request type POST and content-type is text/. This is the error i get Traceback (most recent call last): web-1 | File "/usr/local/lib/python3.8/site-packages/masonite/app.py", line 227, in resolve web-1 | return obj(objects) web-1 | File "/usr/local/lib/python3.8/site-packages/masonite/providers/AppProvider.py", line 61, in boot web-1 | self.app.bind("Request", Request(self.app.make("Environ")).load_app(self.app)) web-1 | File "/usr/local/lib/python3.8/site-packages/masonite/request.py", line 67, in init web-1 | self.load_environ(environ) web-1 | File "/usr/local/lib/python3.8/site-packages/masonite/request.py", line 279, in load_environ web-1 | environ["POST_DATA"] = self.get_post_params() web-1 | File "/usr/local/lib/python3.8/site-packages/masonite/request.py", line 317, in get_post_params web-1 | fields = cgi.FieldStorage( web-1 | File "/usr/local/lib/python3.8/cgi.py", line 477, in init web-1 | self.read_single() web-1 | File "/usr/local/lib/python3.8/cgi.py", line 670, in read_single web-1 | self.read_binary() web-1 | File "/usr/local/lib/python3.8/cgi.py", line 692, in read_binary web-1 | self.file.write(data) web-1 | TypeError: write() argument must be str, not bytes web-1 | web-1 | The above exception was the direct cause of the following exception: web-1 | web-1 | Traceback (most recent call last): web-1 | File "/usr/local/lib/python3.8/site-packages/masonite/wsgi.py", line 27, in response_handler web-1 | container.resolve(provider.boot) web-1 | File "/usr/local/lib/python3.8/site-packages/masonite/app.py", line 232, in resolve web-1 | raise exception(str(e) + " while calling {}".format(obj)) from e web-1 | masonite.exceptions.ContainerError: write() argument must be str, not bytes while calling <bound method AppProvider.boot of <masonite.providers.AppProvider.AppProvider object at 0xffffb305eb50>>

Expected behaviour

No response

Steps to reproduce the bug

No response

Screenshots

No response

OS

macOS

OS version

sonama

Browser

No response

Masonite Version

3.0.11

Anything else ?

No response