<prompt> Ngola lenaneo la middleware ho sefa likopo tsohle tse kenang webosaetengnan  <response>: Instruction in English: Write a middleware program to filter all incoming requests on a website . Response in English: A middleware program is a software component that sits between the web server and the application, intercepting and processing requests before they reach the application. Here is an example of a simple middleware program written in Python using the Flask web framework to filter all incoming requests on a website:pythonfrom flask import Flask, request, abortapp Flask__name__app.before_requestdef filter_requests: Add your filtering logic here if not request.headers.getAPI-KEY SECRET_KEY: abort401 Define your routes hereapp.routedef home: return Welcome to the website!if __name__ __main__: app.runIn this example, the filter_requests function is decorated with the before_request decorator, which means that it will be executed before any request is processed. In this function, we are checking if the request contains an API-KEY header with a value of SECRET_KEY. If the header is not present or the value is incorrect, the request is aborted with an HTTP 401 Unauthorized error.You can modify and extend filter_requests function to add your own custom filtering logic. For instance, you can check the request IP against a blacklist, check the request method, validate the request payload or headers, and so on.Once the middleware has processed the request, it is passed on to the appropriate route handler, where the application can process it and generate a response. . Response in Sesotho: Lenaneo la middleware ke karolo ea software e lutseng lipakeng tsa seva sa marang-rang le tsebeliso, e thibela le ho sebetsana le likopo pele li fihlella kopo. Mohlala ke ona oa lenaneo le bonolo la middleware le ngotsoeng ka Python le sebelisa sebopeho sa webo sa Flask ho sefa likopo tsohle tse kenang webosaeteng: python ho tsoa ho Flask import Flask, kopo, aborne app Flask__name__ app.before_request def filter_requests : Kenya lintlha tsa hau tsa ho sefa mona haeba e se request.headers.getAPI-KEY SECRET_KEY: abort401 Hlalosa litsela tsa hau mona app.route def home : khutla Rea u amohela webosaeteng! haeba __name__ __main__: app.run Mohlaleng ona, mosebetsi oa filtha_likopo o khabisitsoe ka mokhabiso oa pele_kopo, ho bolelang hore o tla etsoa pele kopo efe kapa efe e ka sebetsoa. Mosebetsing ona, re sheba hore na kopo e na le sehlooho sa API-KEY se nang le boleng ba SECRET_KEY. Haeba hlooho e le sieo kapa boleng bo fosahetse, kopo e tlosoa ka phoso e sa lumelloeng ea HTTP 401. O ka fetola le ho holisa tsebetso ea filter_requests ho eketsa mohopolo oa hau oa ho sefa. Mohlala, o ka sheba kopo ea IP khahlano le lenane le nyenyefatsang, hlahloba mokhoa oa kopo, netefatsa phallo ea kopo kapa lihlooho, joalo-joalo. Hang ha middleware e se e sebetsane le kopo, e fetisetsoa ho motho ea sebetsang tsela e loketseng, moo kopo e ka e sebetsanang le ho hlahisa karabo. 