I came with issues with my custom server built on Java Socket. Server works great and transmits data properly with exception of when after HTML form submission I want to redirect browser to success or failure notification address. I send 303 See Other in response to POST sent from mentioned form and page starts refreshing but never ends. It also looks like there is still body on the new request seeking the redirection page.
Here are form request and my 303 response:
POST /html/configPositive.html HTTP/1.1<br/>
Host: localhost:8080<br/>
Connection: keep-alive<br/>
Content-Length: 27<br/>
Cache-Control: max-age=0<br/>
sec-ch-ua: "Google Chrome";v="119", "Chromium";v="119", "Not?A_Brand";v="24"<br/>
sec-ch-ua-mobile: ?0<br/>
sec-ch-ua-platform: "macOS"<br/>
Upgrade-Insecure-Requests: 1<br/>
Origin: http://localhost:8080<br/>
Content-Type: application/x-www-form-urlencoded<br/>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36<br/>
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7<br/>
Sec-Fetch-Site: same-origin<br/>
Sec-Fetch-Mode: navigate<br/>
Sec-Fetch-User: ?1<br/>
Sec-Fetch-Dest: document<br/>
Referer: http://localhost:8080/html/configIndexAbout.html<br/>
Accept-Encoding: gzip, deflate, br<br/>
Accept-Language: pl-PL,pl;q=0.9,en-US;q=0.8,en;q=0.7<br/>
Cookie: Idea-93a338da=1106edad-21ca-4e1f-a631-c60429549309; playername=kotek behemotek; recordblocks=245; recordrows=86<br/>
HTTP/1.1 303 See Other<br/>
Location: /html/configPositive.html
Here is the HTML form:
<form action="/html/configPositive.html" method="post" enctype="application/x-www-form-urlencoded">
<h3>Tutaj wpisz tekst widoczny w About</h3>
<label>
<input type="text" name="/text/about/index">
</label>
<h3>Kiedy skończysz kliknij przycisk. Inaczej zmiany nie zostaną zapisane</h3>
<input type="submit">
</form>