Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ollama
Commits
cff002b8
Commit
cff002b8
authored
Aug 08, 2023
by
Jeffrey Morgan
Browse files
use content type `application/x-ndjson` for streaming responses
parent
55cf5021
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
0 deletions
+1
-0
server/routes.go
server/routes.go
+1
-0
No files found.
server/routes.go
View file @
cff002b8
...
...
@@ -367,6 +367,7 @@ func Serve(ln net.Listener, extraOrigins []string) error {
}
func
streamResponse
(
c
*
gin
.
Context
,
ch
chan
any
)
{
c
.
Header
(
"Content-Type"
,
"application/x-ndjson"
)
c
.
Stream
(
func
(
w
io
.
Writer
)
bool
{
val
,
ok
:=
<-
ch
if
!
ok
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment