GithubHelp home page GithubHelp logo

Comments (9)

pgjones avatar pgjones commented on May 6, 2024

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.

XploitKR avatar XploitKR commented on May 6, 2024

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.

pgjones avatar pgjones commented on May 6, 2024

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.

XploitKR avatar XploitKR commented on May 6, 2024

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.

XploitKR avatar XploitKR commented on May 6, 2024
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.

pgjones avatar pgjones commented on May 6, 2024

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.

XploitKR avatar XploitKR commented on May 6, 2024

ok. im tested migrate to flask.

when using flask working perfectly with same code.

from quart.

pgjones avatar pgjones commented on May 6, 2024

@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.

pgjones avatar pgjones commented on May 6, 2024

Also note #41 which I think also impacts this.

from quart.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.