Skip to content

work with labstack's echo web framework has problem #41

Answered by tmaxmax
wakaka6 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi there, thank you for opening this discussion!

I've investigated this and found the cause: internally, go-sse flushes the request without explicitly writing the header, which triggers an implicit 200 OK write. This implicit write though doesn't toggle some internal Echo flags which then causes Echo to write the header again, hence the "superfluous" write. This is benign and you don't need to worry.

You shouldn't have see this warning every time, though – it is annoying and may distract attention from important warnings. Here's a way you can integrate go-sse with echo without such warnings (used your code as starting point):

package main

import (
	"errors"
	"fmt"
	"log"
	"net/http"
	"time"

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by tmaxmax
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants