jczic / MicroWebSrv2

The last Micro Web Server for IoTs (MicroPython) or large servers (CPython), that supports WebSockets, routes, template engine and with really optimized architecture (mem allocations, async I/Os). Ready for ESP32, STM32 on Pyboard, Pycom's chipsets (WiPy, LoPy, ...). Robust, efficient and documented!
https://github.com/jczic/MicroWebSrv2
MIT License
655 stars 97 forks source link

[307] Temporary Redirect #65

Open dejanristic78 opened 3 years ago

dejanristic78 commented 3 years ago

I'm playing around with MicroWebSrv2 on an esp32.

The following demo features are working just fine: Test a POST form Test the WebSockets page *Test the multi-user chat page

But these links doesn't work and generates a "[307] Temporary Redirect" debug message: Test a redirection Test a pyhtml template page *View a PDF file

Also, whenever "favicon.ico" is requested i get the same debug message: MWS2-DEBUG> From 192.168.0.14:58705 GET /favicon.ico >> [307] Temporary Redirect

What could be the reason for this?

chris-reichl commented 2 years ago

I also received a [307] Temporary Redirect error and was able to solve the problem as follows:

Cause of [307] Temporary Redirect error: I had the problem that files like .ico, .png and .pdf are excluded from uploading with Pymark. So they were not present in the file system of the microcontroller and could not be found, which then led to the [307] Temporary Redirect error.

Solution: The files that are to be taken into account during upload must be explicitly specified in the project settings of Pymark. In my case I had to add the following line, then everything worked fine: "sync_file_types": "py,txt,log,json,xml,html,js,css,mpy,pdf,ico,png,svg"

image

Information about the microcontroller: Pycom MicroPython 1.20.2.r6 [v1.11-c5a0a97] on 2021-10-28; FiPy with ESP32