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

Erroneous redirects appearing for static files. #1052

Closed
hugo opened this issue Oct 14, 2013 · 12 comments
Closed

Erroneous redirects appearing for static files. #1052

hugo opened this issue Oct 14, 2013 · 12 comments

Comments

@hugo
Copy link
Contributor

hugo commented Oct 14, 2013

My chrome dev tools are being flooded with 302 redirects for static files, as Ghost is adding a trailing slash to them. I understand that it has been decided that elsewhere in Ghost the forced addition of trailing slashes is the desired behaviour (i.e. /ghost/ not /ghost), but I doubt this is desired behaviour.

screen shot 2013-10-14 at 22 12 46

p.s. sorry to bang on about trailing slashes, I know it's a minor thing but I had a big debate about them over the weekend so it's a hot/fresh topic in my mind.

@ErisDS
Copy link
Member

ErisDS commented Oct 14, 2013

I'm not sure why you're getting these 302s - the fact you're getting these is the problem that needs investigating, rather than the trailing slashes. The way Ghost is set up, static files should be served before the trailing slashes are added.

Often what we see is that a file isn't served by the static middleware, and gets a slash added to it before it's served up by the 404 error handling middleware at the very end.

Have you made changes to the middleware, and have you run all the grunt commands etc?

@hugo
Copy link
Contributor Author

hugo commented Oct 15, 2013

Looks like the Grunt command failed for me. I'll add a screencast showing what I see as a result though, because it could definitely be improved.

@halfdan
Copy link
Contributor

halfdan commented Oct 15, 2013

#935 might be related

@aranw
Copy link

aranw commented Oct 17, 2013

Am getting a similar issue and its resulting in being unable to setup Ghost.

When I try access /ghost/signup.

screen shot 2013-10-17 at 13 50 03

@ErisDS
Copy link
Member

ErisDS commented Oct 17, 2013

If you're running in development mode, then you need to run 'grunt init' otherwise if you're in production mode, you need to run 'grunt prod'
See https://github.com/TryGhost/Ghost/blob/master/CONTRIBUTING.md#installation--setup-instructions

@ErisDS ErisDS closed this as completed Oct 17, 2013
@aranw
Copy link

aranw commented Oct 18, 2013

I ended up getting this going, bit disappointed that it took me so long the instructions seem very fragmented and don't actually state all the requirements, I was missing Sass and Bourbon and it didn't actually tell me that they were missing properly.

@ErisDS
Copy link
Member

ErisDS commented Oct 18, 2013

We've listed out all the requirements in the contributing file. https://github.com/TryGhost/Ghost/blob/master/CONTRIBUTING.md#working-on-ghost-core

If you have a better way to do it, please submit a PR!

@hugo
Copy link
Contributor Author

hugo commented Oct 18, 2013

Sorry I didn't follow up on this as promised - one of our guys decided to infect the network with a particularly nasty virus, and as I'm the IT guy as well as developer, I had to deal with that...

Anyway, here's the rub:, when you are missing static file, you get a 302 then a 200, the body text of which is the 404 text. In my opinion, there needs to be an intercept in the static files path that 404s properly when the files are missing, rather than simply "passing the buck" down (up?) the middleware chain.

Further, because it's a Backbone app, a lack of JavaScript means you just get a blank page currently. Could Ghost at least throw up a message to the effect of "Ghost requires JavaScript be loaded to run, either these files didn't load, or you are blocking scripts intentionally" so the problem is clearly stated to the end user?

@aranw
Copy link

aranw commented Oct 18, 2013

@ErisDS I think the issue was I was following the README file and the docs.ghost.org pages, which don't list the requirements and don't show how to setup your environment with these tools which are required, the docs on docs.ghost.org show install node, which is what I followed, thinking thats all I needed whereas what a user would of expected is a guide on setting up grunt, sass and bourbon. Which is a very important step in deploying Ghost IMO.

@aranw
Copy link

aranw commented Oct 18, 2013

@thisishugo I agree with you here, the blank page was very confusing and didn't really explain to me the files were actually missing. Missing files should respond with 404s not 304s, 304s imply the file has been moved.

@ErisDS
Copy link
Member

ErisDS commented Oct 20, 2013

@aranw The README states that there are 2 ways to get started, and points to the Contributor docs for instructions for how to setup from git. I do not know how to make this any clearer than it is. Suggestions welcome.

With regards to the response message being wrong, that is being dealt with in #1152

The idea to add a message to make it clear that the JavaScript has not loaded is reasonable, perhaps someone would like to open that as an issue?

@hugo
Copy link
Contributor Author

hugo commented Oct 21, 2013

@ErisDS To the first, aside from making the process more automatic, nothing, and that's a difficult task. To the second, excellent. To the last, done.

kevinansfield added a commit that referenced this issue Nov 9, 2023
refs #18752, TryGhost/Product#3897, TryGhost/Product#4112, TryGhost/Product#4104, #18866, #18753, TryGhost/Product#4116, #18888, #18844

- 🐛 Fixed browser focus on editor when clicking card ([Koenig/#1051](TryGhost/Koenig#1051))
- 🐛 Fixed signup card styles with image background ([Koenig/#1052](TryGhost/Koenig#1052))
- 🐛 Fixed slash menu having fixed position when scrolling ([Koenig/#1054](TryGhost/Koenig#1054))
- 🐛 Fixed signup card text color with transparent background ([Koenig/#1053](TryGhost/Koenig#1053))
- 🐛 Fixed text formats being lost when copy/pasting from Google Docs ([Koenig/#1055](TryGhost/Koenig#1055))
- 🐛 Fixed pasting link behaviour in single line nested editors ([Koenig/#1056](TryGhost/Koenig#1056))
- 🐛 Fixed backspace behaviour at start of aside/quote ([Koenig/#1057](TryGhost/Koenig#1057))
- 🐛 Fixed text having unexpected formats when rendering ([Koenig/#1058](TryGhost/Koenig#1058))
- 🐛 Fixed placeholder descenders being cut off in nested editor ([Koenig/#1059](TryGhost/Koenig#1059))
- 🐛 Fixed HTML->Lexical conversion not handling paragraphs inside blockquotes ([Koenig/#1061](TryGhost/Koenig#1061))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants