Comments (9)
I think the 404 must be an issue with the request you are making (to a path that you don't have defined), rather than anything to do with HTTP/2 or SSL.
How is the file being sent? If it is not streamed then it would likely take time.
I'm not sure what the 20kb issue is, is there an error? Is there a restriction on the system?
from quart.
when i use no ssl, http2 server and my webapp working perfectly.
img upload more than 20kb work fine.
i tried normal html form, dropzone.js, ngx-editor image upload.
all the same issue.
from quart.
Does it work with SSL but no HTTP/2?
It is quite hard to figure this out from the information given, are there any error messages or warnings?
from quart.
no error, no warnings..
i think await request.files infinity await.
only image upload things.
suddenly 404 error come out static img, js, css etc.
sorry for my bad eng.T.T
from quart.
APP_ROOT = os.path.dirname(os.path.abspath(__file__))
UPLOAD_FOLDER = os.path.join(APP_ROOT, 'static/shop/imgs')
EDITOR_UPLOAD_FOLDER = os.path.join(APP_ROOT, 'static/shop/content')
NOTICE_UPLOAD_FOLDER = os.path.join(APP_ROOT, 'static/notice/imgs')
MAGAZINE_UPLOAD_FOLDER = os.path.join(APP_ROOT, 'static/magazine/imgs')
MAGAZINE_CONTENT_UPLOAD_FOLDER = os.path.join(APP_ROOT, 'static/magazine/content')
app = Quart(__name__, static_url_path='', static_folder='static')
app.config['SERVER_NAME'] = "xxxx.com"
app.url_map.host_matching = True
app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
app.config['EDITOR_UPLOAD_FOLDER'] = EDITOR_UPLOAD_FOLDER
app.config['NOTICE_UPLOAD_FOLDER'] = NOTICE_UPLOAD_FOLDER
app.config['MAGAZINE_UPLOAD_FOLDER'] = MAGAZINE_UPLOAD_FOLDER
app.config['MAGAZINE_CONTENT_UPLOAD_FOLDER'] = MAGAZINE_CONTENT_UPLOAD_FOLDER
cors(app)
@app.route('/', methods=['GET'], subdomain="cms")
async def rootCms():
#return await render_template('index.html', session = session)
return await app.send_static_file('cms/index.html')
@app.route('/<path:path>', methods=['GET'], subdomain="cms")
async def staticfileCms(path):
#return await render_template('index.html', session = session)
if path.find('shop') == 0 or path.find('notice') == 0 or path.find('magazine') == 0:
return await app.send_static_file(path)
else:
return await app.send_static_file('cms/'+path)
@app.route('/', methods=['GET'], subdomain="m")
async def rootMobile():
#return await render_template('index.html', session = session)
return await app.send_static_file('mobile/index.html')
@app.route('/<path:path>', methods=['GET'], subdomain="m")
async def staticfileMobile(path):
#return await render_template('index.html', session = session)
if path.find('shop') == 0 or path.find('notice') == 0 or path.find('magazine') == 0:
return await app.send_static_file(path)
else:
return await app.send_static_file('mobile/'+path)
@app.route('/', methods=['GET'])
async def root():
#return await render_template('index.html', session = session)
return await app.send_static_file('index.html')
@app.route('/<path:path>', methods=['GET'])
async def staticfile(path):
#return await render_template('index.html', session = session)
return await app.send_static_file(path)
from Routes.User import *
from Routes.Cms import *
from Routes.Shop import *
from Routes.Notice import *
from Routes.Magazine import *
if __name__ == "__main__":
ssl_context = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH)
ssl_context.options |= ssl.OP_NO_TLSv1 | ssl.OP_NO_TLSv1_1 | ssl.OP_NO_COMPRESSION
ssl_context.set_ciphers('ECDHE+AESGCM')
ssl_context.load_cert_chain(certfile='semoplace.crt', keyfile='semoplace.key')
ssl_context.set_alpn_protocols(['h2', 'http/1.1'])
app.run(host='0.0.0.0', port=443, ssl=ssl_context)
#app.run(host='0.0.0.0', port=80)
my main.py source code.
from quart.
Thanks, I'm not sure from this what the issue is. I'll keep it in mind and try thinking what it could be.
If you make any progress please update.
from quart.
ok. im tested migrate to flask.
when using flask working perfectly with same code.
from quart.
@kowbot I think this is likely fixed in the latest version of Hypercorn - as I suspect it was a flow control issue fixed in this commit. Could you try with the latest code and see if this is still a problem?
from quart.
Also note #41 which I think also impacts this.
from quart.
Related Issues (20)
- cannot import name 'url_quote' from 'werkzeug.urls' HOT 4
- fail pytest HOT 1
- Should `quart.make_response` be typed as returning `Response`?
- Task was destroyed but it is pending!
- `get_template_attribute` is not available in async mode HOT 1
- is_coroutine_function missing error with latest release 0.19.4 HOT 1
- TypeError: cannot use a string pattern on a bytes-like object HOT 1
- Add support mount other ASGI applications HOT 1
- Support after_response
- How to share websocket context in quart
- app.teardown_websocket no longer exists HOT 2
- Enhancing Blueprint Lifecycle Order
- ResourceWarning from `DataBody.__aiter__` HOT 1
- ResourceWarning: Unclosed file <tempfile.SpooledTemporaryFile object at 0...> in form handling HOT 1
- Server sent events seem to be capped at 6 connections HOT 1
- DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC). HOT 2
- support insecure bind HOT 2
- Cannot load `QUART_` prefixed environment variables HOT 1
- AttributeError: 'Config' object has no attribute 'from_json' HOT 1
- async function support in url_defaults and url_value_preprocessor HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from quart.