[PR #570] [MERGED] fix HEAD request #10228

Closed
opened 2026-04-12 22:55:13 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/570
Author: @mxyng
Created: 9/21/2023
Status: Merged
Merged: 9/21/2023
Merged by: @mxyng

Base: mainHead: mxyng/head-request


📝 Commits (2)

📊 Changes

1 file changed (+8 additions, -8 deletions)

View changed files

📝 server/routes.go (+8 -8)

📄 Description

HEAD request should respond like their GET counterparts except without a response body.

The previous implementation didn't quite satisfy this since it doesn't attach a response body so the content length is zero while the GET request responded with Ollama is running, content length 17.

Despite having a response body, gin will omit it in the actual response:

$ http HEAD :11434/
HTTP/1.1 200 OK
Content-Length: 17
Content-Type: text/plain; charset=utf-8
Date: Thu, 21 Sep 2023 23:41:08 GMT




$ http GET :11434/
HTTP/1.1 200 OK
Content-Length: 17
Content-Type: text/plain; charset=utf-8
Date: Thu, 21 Sep 2023 23:41:11 GMT

Ollama is running




🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/570 **Author:** [@mxyng](https://github.com/mxyng) **Created:** 9/21/2023 **Status:** ✅ Merged **Merged:** 9/21/2023 **Merged by:** [@mxyng](https://github.com/mxyng) **Base:** `main` ← **Head:** `mxyng/head-request` --- ### 📝 Commits (2) - [`c986694`](https://github.com/ollama/ollama/commit/c98669436742f79f8ffaa796ff94ee2c7f17201a) fix HEAD / request - [`82f5b66`](https://github.com/ollama/ollama/commit/82f5b66c01b11d706c1797ab676054d309724c6e) register HEAD /api/tags ### 📊 Changes **1 file changed** (+8 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `server/routes.go` (+8 -8) </details> ### 📄 Description HEAD request should respond like their GET counterparts except without a response body. The previous implementation didn't quite satisfy this since it doesn't attach a response body so the content length is zero while the GET request responded with `Ollama is running`, content length 17. Despite having a response body, gin will omit it in the actual response: ``` $ http HEAD :11434/ HTTP/1.1 200 OK Content-Length: 17 Content-Type: text/plain; charset=utf-8 Date: Thu, 21 Sep 2023 23:41:08 GMT $ http GET :11434/ HTTP/1.1 200 OK Content-Length: 17 Content-Type: text/plain; charset=utf-8 Date: Thu, 21 Sep 2023 23:41:11 GMT Ollama is running ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-12 22:55:13 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#10228