Bad request the browser or proxy sent a request that this server could not understand

Bad request the browser or proxy sent a request that this server could not understand

Bad Request, Your browser sent a request that this server could not understand

There are two application servers and a switch. When i access application by using application server ip it works fine. However if i use switch ip in my url Bad request error throws up only for firefox and chrome for a few links only.

15 Answers 15

Trending sort

Trending sort is based off of the default sorting method — by highest score — but it boosts votes that have happened recently, helping to surface more up-to-date answers.

It falls back to sorting by highest score if no posts are trending.

Switch to Trending sort

Here is a detailed explanation & solution for this problem from ibm.

Problem(Abstract)

Request to HTTP Server fails with Response code 400.

Symptom

Response from the browser could be shown like this:

Bad Request Your browser sent a request that this server could not understand. Size of a request header field exceeds server limit.

HTTP Server Error.log shows the following message: «request failed: error reading the headers»

Cause

This is normally caused by having a very large Cookie, so a request header field exceeded the limit set for Web Server.

Diagnosing the problem

To assist with diagnose of the problem you can add the following to the LogFormat directive in the httpd.conf: error-note: %n

Resolving the problem

For server side: Increase the value for the directive LimitRequestFieldSize in the httpd.conf: LimitRequestFieldSize 12288 or 16384 For How to set the LimitRequestFieldSize, check Increase the value of LimitRequestFieldSize in Apache

For client side: Clear the cache of your web browser should be fine.

I was called to give maintenance on a project in cake php. The customer had the project running perfectly on his hosting, and accidentally deleted the entire contents, then I was called to redo the deploy into a new hosting.

I did the standard procedure, I copied all files to an FTP directory, and fix new connection links with the database in database.php files and wordpresscomponent.php (since the project has an integration with a page on wordpress) and also in the wp-config.php own folder that runs the other application in wordpress.

At first I was quite open issues on the site, broken images and forms not working. I realized I was missing permissions on the temp folder (after uploading the files in the new FTP new provider), then gave permission 755 in the temp folder in the core of the internal folder and the «files» folder in \ app \ webroot \ files also realized my Filezilla corrupted files and images to upload, then had to redo the whole upload new files. And the site has returned to work.

But I have a problem in the design of the administrative panel. There is a tab that register objects of type «products» and «newspaper» which are text with images (representing products that are going on the site page).

Whenever I edit an information of that page, I get the error mentioned in this topic. » 400 Bad Request

Your browser sent a request that this server could not understand.»

UPDATE: I noticed that the error is related to a table that is loaded in the product object information. If I edit a product, and exclude this table, or create a new product, the error shows different, which seems to be related only to a function that loads images:

«The browser (or proxy) sent a request that this server could not understand.»

I am trying to build a website with an ML model using Flask and Python.

I keep getting this error when I input the values to get the prediction

The browser (or proxy) sent a request that this server could not understand.

Here is the code I have written so far.

This is the app.py file

This is the index.html file:

The image attached shows the dataset and the columns present. Bad request the browser or proxy sent a request that this server could not understand. Смотреть фото Bad request the browser or proxy sent a request that this server could not understand. Смотреть картинку Bad request the browser or proxy sent a request that this server could not understand. Картинка про Bad request the browser or proxy sent a request that this server could not understand. Фото Bad request the browser or proxy sent a request that this server could not understand

Any ideas on how to fix this error?

Bad request the browser or proxy sent a request that this server could not understand. Смотреть фото Bad request the browser or proxy sent a request that this server could not understand. Смотреть картинку Bad request the browser or proxy sent a request that this server could not understand. Картинка про Bad request the browser or proxy sent a request that this server could not understand. Фото Bad request the browser or proxy sent a request that this server could not understand

1 Answer 1

Flask actually indicates the cause of the error.

The initial problem is that your keys have some extra spaces:

The spaces are not automatically stripped, and spaces matter:

Check all your keys on your HTML and Python code, and make sure they are consistent. The same error will also happen if your view function tries to access a form key that is not in the HTML template.

A big improvement you can do here is to define an iterable (ex. list, tuple, etc.) to store all the keys. Pass that iterable to your HTML template, and dynamically generate the form for each key, since your example shows they are all just copy-pasted with different name ‘s and placeholder ‘s. Then in your view function, again loop through this same iterable to parse the form.

That should help prevent inconsistencies in the form keys, and improves the maintainability since you only need to update and check the keys in 1 place.

Источники информации:

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *