Can you edit this script so that if the inputted text in the query isnt a .m3u8 or .mp4,…
- User
Can you edit this script so that if the inputted text in the query isnt a .m3u8 or .mp4, or it doesnt start with "http://" or "https://", it returns invalid URL?
package main import ( "html" "log" "github.com/gofiber/fiber/v2" ) func main() { app := fiber.New(fiber.Config{ Prefork: true, }) app.Static("/", ".", fiber.Static{ Index: "index.html", }) app.Get("/play", func(c *fiber.Ctx) error { query := c.Query("query") if query == "" { return c.SendString("") } return c.SendString("You searched for: " + html.EscapeString(query)) }) if err := app.Listen(":80"); err != nil { log.Fatalf("Error starting server: %v", err) } } Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.