Youssef Youssef - 27 days ago 7
HTML Question

Bad or long request

I have a long form to fit and sometimes the session is invalid and when I press the submit button I lose all of my data. Luckily, I managed to save the next url after the redirect on login form. It works fine without any problems with other links.

But When I Try the query bellow of the long form :

http://localhost:8080/ao-server/administration/connexion_admin?next=http%3A%2F%2Flocalhost%3A8080%2Fao-server%2Fadministration%2FAO%2Fsave%3Fetat_ao%3Dnew%26pme%3D0%26acheteur%3D1274%26typemarche%3D9%26reference%3D51%252FMEK%252F2016%2B%26dateouvertureplis%3D01%252F12%252F2016%26heure%3D09%26minute%3D00%26objet%3DEtude%2BArchitecturale%2Bet%2Bsuivi%2Bdes%2Btravaux%2Bd%25E2%2580%2599extension%2Bde%2BS%252FS%2BOuled%2BSlime%2Bcentre%2BCR%2BM%25E2%2580%2599Haya%2BProvince%2Bde%2BMekn%25C3%25A8s%2B%26estimation%3D2%26provinces%3D17-3%26datepublication%3D05%252F11%252F2016%26selectedactivites%3D505-3%26idao%3D16399%26from%3Dcontrole%26idfils%3D%26idModif%3D%26origin%3D%26content%3D%253Cstrong%253EROYAUME%2BDU%2BMAROC%2B%253Cbr%253E%253Cbr%253EMINIST%25C3%2588RE%2BDE%2BL%25E2%2580%2599EDUCATION%2BNATIONALE%2BET%2BDE%2BLA%2BFORMATION%2BPROFESSIONNELLE%2B%253Cbr%253E%253Cbr%253EACAD%25C3%2589MIE%2BR%25C3%2589GIONALE%2BDE%2BL%25E2%2580%2599%25C3%2589DUCATION%2BET%2BDE%2BLA%2BFORMATION%2BR%25C3%2589GION%2BDE%2BF%25C3%2588S-MEKN%25C3%2588S%2B%253Cbr%253E%253Cbr%253EDIRECTION%2BPROVINCIALE%2BDE%2BMEKN%25C3%2588S%2B%253Cbr%253E%253Cbr%253ESERVICE%2BDES%2BAFFAIRES%2BADMINISTRATIVES%2BET%2BFINANCI%25C3%2588RES%2B%253Cbr%253E%253Cbr%253EBUREAU%2BDES%2BMARCHES%253C%252Fstrong%253E%253Cbr%253E%253Cbr%253E%253Cbr%253EAVIS%2BDE%2BCONSULTATION%2BARCHITECTURALE%2BN%25C2%25B0%25C2%25A0%253Cstrong%253E51%252FMEK%252F2016%253C%252Fstrong%253E%25C2%25A0%253Cbr%253E%253Cbr%253E%253Cbr%253E%253Cstrong%253ELe%2B01%252F12%252F2016%2B%25C3%25A0%2Bpartir%2Bde%2B09%2BH%253C%252Fstrong%253E%2B%252Cselon%2Bci-apr%25C3%25A8s%252C%2Bil%2Bsera%2Bproc%25C3%25A9d%25C3%25A9%2Bdans%2Bla%2Bsalle%2Bdes%2Br%25C3%25A9unions%2B%25C3%25A0%2Bla%2BDirection%2BProvinciale%2Bde%2BAcad%25C3%25A9mie%2Br%25C3%25A9gionale%2Bde%2Bl%25E2%2580%2599%25C3%25A9ducation%2Bet%2Bde%2Bla%2Bformation%2BR%25C3%25A9gion%2Bde%2BF%25C3%25A8s-Mekn%25C3%25A8s%252C%2BAvenue%2BAbdelkrim%2BEl%2BKhattabi%2BSbata%2B%25C3%25A0%2BMekn%25C3%25A8s%2B%25C3%25A0%2Bl%25E2%2580%2599ouverture%2Bdes%2Bplis%2Bdes%2Barchitectes%2Brelatif%2Bau%2Bconsultation%2Barchitecturale%2Bsuivante%253A%2B%253Cbr%253E%253Cbr%253E-%2BN%25C2%25B0%2Bde%2Bla%2Bconsultation%2Barchitecturale%253A%2B%253Cstrong%253E51%252FMEK%252F2016%253C%252Fstrong%253E%2B%253Cbr%253E%253Cbr%253E-%2BObjet%253A%2B%253Cstrong%253EEtude%2BArchitecturale%2Bet%2Bsuivi%2Bdes%2Btravaux%2Bd%25E2%2580%2599extension%2Bde%2BS%252FS%2BOuled%2BSlime%2Bcentre%2BCR%2BM%25E2%2580%2599Haya%2BProvince%2Bde%2BMekn%25C3%25A8s%253C%252Fstrong%253E%2B%253Cbr%253E%253Cbr%253E%253Cstrong%253E-%2BBudget%2BPr%25C3%25A9visionnel%2Bmax%2BHT%253C%252Fstrong%253E%2Bpour%2Bl%25E2%2580%2599ex%25C3%25A9cution%2Bdes%2Btravaux%2Ben%2BDhs%253A%2B%253Cstrong%253E666%2B000.00%2BDH%253C%252Fstrong%253E%2BSix%2Bcent%2Bsoixante-six%2Bmille%2B%253Cbr%253E%253Cbr%253ELe%2Bdossier%2Bde%2Bla%2Bconsultation%2Barchitecturale%2Bpeut%2B%25C3%25AAtre%2Bretir%25C3%25A9%2Bau%2BBureau%2Bdes%2Bmarch%25C3%25A9s%2Bde%2Bla%2BDirection%2BProvinciale%2Bde%2Bl%25E2%2580%2599AREF%2BR%25C3%25A9gion%2BF%25C3%25A8s-Mekn%25C3%25A8s%2B%25C3%25A0%2BMekn%25C3%25A8s%252C%2Bil%2Bpeut%2B%25C3%25A9galement%2B%25C3%25AAtre%2Bt%25C3%25A9l%25C3%25A9charg%25C3%25A9%2B%25C3%25A0%2Bpartir%2Bdu%2Bportail%2Bdes%2Bmarch%25C3%25A9s%2Bpublics%2Bwww.marchespublics.gov.ma%2B%253Cbr%253E%253Cbr%253ELe%2Bcontenu%2Bainsi%2Bque%2Bla%2Bpr%25C3%25A9sentation%2Bdes%2Bdossiers%2Bdes%2Bconcurrents%2Bdoivent%2B%25C3%25AAtre%2Bconformes%2Baux%2Bdispositions%2Bdes%2Barticles%2B100%252C%2B101%2Bet%2B102%2Bdu%2Bd%25C3%25A9cret%2Bn%25C2%25B0%2B2-12-349%2Bdu%2B8%2Bjoumada%2BI%2B1434%2B%252820%2Bmars%2B2013%2529%2Bfixant%2Bles%2Bconditions%2Bet%2Bles%2Bformes%2Bde%2Bpassation%2Bdes%2Bmarch%25C3%25A9s%2Bpour%2Ble%2Bcompte%2Bde%2Bl%25E2%2580%2599Etat%2Bet%2Bdes%2B%25C3%25A9tablissements%2Bpublics%2Bainsi%2Bque%2Bcertaines%2Br%25C3%25A8gles%2Brelatives%2B%25C3%25A0%2Bleurs%2Bgestion%2Bet%2B%25C3%25A0%2Bleur%2Bcontr%25C3%25B4le.%2B%253Cbr%253E%253Cbr%253ELes%2Barchitectes%2Bpeuvent%253A%2B%253Cbr%253E%253Cbr%253E-Soit%2Bd%25C3%25A9poser%2Bcontre%2Br%25C3%25A9c%25C3%25A9piss%25C3%25A9%2Bleurs%2Bplis%2Bdans%2BBureau%2Bdes%2Bmarch%25C3%25A9s%2Bde%2Bla%2BDirection%2BProvinciale%2Bde%2BMekn%25C3%25A8s.%2B%253Cbr%253E-Soit%2Bles%2Benvoyer%252C%2Bpar%2Bcourrier%2Brecommand%25C3%25A9%2Bavec%2Baccus%25C3%25A9%2Bde%2Br%25C3%25A9ception%2Bau%2BBureau%2Bpr%25C3%25A9cit%25C3%25A9.%2B%253Cbr%253E-Soit%2Bles%2Bremettre%2Bau%2Bpr%25C3%25A9sident%2Bdu%2Bjury%2Bde%2Bla%2Bconsultation%2Barchitecturale%2Bau%2Bd%25C3%25A9but%2Bde%2Bla%2Bs%25C3%25A9ance%2Bet%2Bavant%2Bl%25E2%2580%2599ouverture%2Bdes%2Bplis.%2B%253Cbr%253E%253Cbr%253ELes%2Bpi%25C3%25A8ces%2Bjustificatives%2B%25C3%25A0%2Bfournir%2Bsont%2Bcelles%2Bpr%25C3%25A9vues%2Bpar%2Bl%25E2%2580%2599article%2B10%2Bdu%2Br%25C3%25A8glement%2Bde%2Bconsultation%2Barchitecturale.%253Cbr%253E%253Cbr%253E%2BLes%2Bpi%25C3%25A8ces%2Bfournies%2Bdoivent%2B%25C3%25AAtre%2Boriginales%2Bou%2Bcopies%2Bcertifi%25C3%25A9es%2Bconformes%2B%25C3%25A0%2Bl%25E2%2580%2599original%2Bde%2Bmoins%2Bde%2Btrois%2Bmois.


i got this exception :

nov. 10, 2016 10:10:29 PM org.apache.coyote.http11.AbstractHttp11Processor process
INFOS: Error parsing HTTP request header


it's a bad request

Request Method:POST
Status Code:400 bad request


Or it's a long query because the link it work directly when i save the form and the user is logged

So How can I solve this to prevent my admins repeating a long form ?

Answer

With a request URL of over 4000 characters (and your example is above 5000) you can get an Http 400 response, depending on browser/server side implementation.