As we initially determined over on the forum, there is a bug in my local dev environment where I get 403 HTTP responses from requests to a file path, such as for a JPG image, but only when logged in as an admin, and as far as I can tell, only in the browser, not when requesting from Node.
Here are the request headers from such a failed request:
When logged in as a non-admin user, however, it works:
@mstenta indicated that farmOS/farmOS#563 may possibly be related, though it's not clear exactly how. @symbioquine also provided a helpful testing script, which seems to work on most live farmOS instances in production, at least for non-admins:
I feel pretty confident this is some combo of my local proxy settings and something to do with admin users. I'm tempted to merge my changes on the field-module-observations branch into develop so we can test it out on https://develop.farmos.app, which would eliminate any issues with the local proxy, although that will also necessitate packaging and installing the Observations module on https://test.farmos.dev or a similar live test server. But like I say, I will need to divert my attention to other issues for the next week, so perhaps that will just be a good place to pick this up again on the other side.
Unforunately, "for the next week" became the next 4 months. Since I'm finally picking this back up and aiming to achieve a bare MVP of the Observations module for release, no matter if it's buggy on edge cases, I will probably just punt on this until it becomes a major blocker in other regards.
As we initially determined over on the forum, there is a bug in my local dev environment where I get 403 HTTP responses from requests to a file path, such as for a JPG image, but only when logged in as an admin, and as far as I can tell, only in the browser, not when requesting from Node.
Here are the request headers from such a failed request:
... and the corresponding 403 response headers:
When logged in as a non-admin user, however, it works:
@mstenta indicated that farmOS/farmOS#563 may possibly be related, though it's not clear exactly how. @symbioquine also provided a helpful testing script, which seems to work on most live farmOS instances in production, at least for non-admins:
Finally, as I summed up in my last comment on the forum:
Unforunately, "for the next week" became the next 4 months. Since I'm finally picking this back up and aiming to achieve a bare MVP of the Observations module for release, no matter if it's buggy on edge cases, I will probably just punt on this until it becomes a major blocker in other regards.