Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server: Handle HEAD requests to frontend bootstrap resources #2965

Closed
averymd opened this issue Dec 4, 2022 · 2 comments
Closed

Server: Handle HEAD requests to frontend bootstrap resources #2965

averymd opened this issue Dec 4, 2022 · 2 comments
Assignees
Labels
bug Something isn't working released Available in the stable release

Comments

@averymd
Copy link

averymd commented Dec 4, 2022

1. What is not working as documented?

On build 221118-e58fee0fb, Photoprism returns 404s for HEAD requests to URLs that return 200s when GET requests are made. This began mid-October; I presumably upgraded to the Sept 1 release then. I use HEAD requests to monitor the uptime of the app.

2. How can we reproduce it?

Steps to reproduce the behavior:

  1. Set up build 221118-e58fee0fb (Photoprism Plus) in docker; it doesn't matter if webdav is enabled
  2. With the container running, use curl to make a GET request to the login page and see that a 200 is returned in the headers: curl -i -s http://127.0.0.1:2342/library/login
  3. Run a HEAD request against the same URL and get a 404: curl -I -s http://127.0.0.1:2342/library/login

3. What behavior do you expect?

The HEAD request should return the same status code as its matching GET request, as it did previously.

4. What could be the cause of your problem?

I'm not familiar with Go, but it was updated in the Sept 2022 release.

5. Can you provide us with example files for testing, error logs, or screenshots?

N/A, but I can provide some docker-compose details if that would be helpful.

6. Which software versions do you use?

(a) PhotoPrism Architecture & Build Number: ARMv7 build 221118-e58fee0fb,

(b) Database Type & Version: MariaDB 10.8

(c) Operating System Types & Versions: Raspbian GNU/Linux 10 (buster)

7. On what kind of device is PhotoPrism installed?

(a) Device / Processor Type: Raspberry Pi 4

8. Do you use a Reverse Proxy, Firewall, VPN, or CDN?

I usually run nginx as a reverse proxy, but the curl commands bypass it, so it shouldn't be relevant.

@averymd averymd added the bug Something isn't working label Dec 4, 2022
@lastzero
Copy link
Member

lastzero commented Dec 4, 2022

Use the GET /api/v1/status endpoint:

https://demo.photoprism.app/api/v1/status

@lastzero
Copy link
Member

lastzero commented Dec 4, 2022

It's fundamentally because we don't do a redirect for unhandled URLs anymore. To solve this, we can add a head handler in addition to get. Thought the framework catches this.

@lastzero lastzero changed the title Photoprism incorrectly returns 404 for HEAD requests Server: Handle HEAD requests Feb 9, 2023
lastzero added a commit that referenced this issue Feb 9, 2023
Signed-off-by: Michael Mayer <michael@photoprism.app>
@lastzero lastzero added the please-test Ready for acceptance test label Feb 9, 2023
@lastzero lastzero self-assigned this Feb 9, 2023
@lastzero lastzero changed the title Server: Handle HEAD requests Server: Handle HEAD requests to bootstrap resources Feb 9, 2023
@lastzero lastzero changed the title Server: Handle HEAD requests to bootstrap resources Server: Handle HEAD requests to frontend bootstrap paths Feb 9, 2023
@lastzero lastzero changed the title Server: Handle HEAD requests to frontend bootstrap paths Server: Handle HEAD requests to frontend bootstrap resources Feb 9, 2023
@lastzero lastzero moved this to Released 🌈 in Roadmap 🚀✨ Jun 27, 2023
@lastzero lastzero added tested Changes have been tested successfully released Available in the stable release and removed please-test Ready for acceptance test tested Changes have been tested successfully labels Jun 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released Available in the stable release
Projects
Status: Release 🌈
Development

No branches or pull requests

2 participants