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

next and prev rel links in head should detect https #4266

Closed
MaluNoPeleke opened this issue Oct 11, 2014 · 9 comments · Fixed by #4304
Closed

next and prev rel links in head should detect https #4266

MaluNoPeleke opened this issue Oct 11, 2014 · 9 comments · Fixed by #4304
Labels
bug [triage] something behaving unexpectedly good first issue [triage] Start here if you've never contributed before. P2 - High [triage] High priority for immediate patch release
Milestone

Comments

@MaluNoPeleke
Copy link

I have added a SSL certificate to my Ghost blog and noticed, that the next and prev rel links in head won't use https for links but every other link does.
You can check it live on https://www.peleke.de vs. http://www.peleke.de

Ghost 0.5.2
See bug #685

@ErisDS ErisDS added bug [triage] something behaving unexpectedly good first issue [triage] Start here if you've never contributed before. labels Oct 12, 2014
@ErisDS ErisDS added this to the 0.5.x Backlog milestone Oct 12, 2014
@jillesme
Copy link
Contributor

I'll take this one on!

@jillesme
Copy link
Contributor

@MaluNoPeleke have you updated your ghost config URL to use https too?

@novaugust
Copy link
Contributor

Yeah, looking into the code, prev and next already use SSL - provided you've set the urlSSL option in config.js. See this blog post for an example.

You can also define your plain "url" to use "https", which would also take care of the issue.

@novaugust
Copy link
Contributor

Right, I've done a bit more digging around and it looks like that is indeed the solution, and I don't see anything code-wise that needs changing. Going to close this for now, @MaluNoPeleke by all means come back if it doesn't fix your problem and we'll keep digging =)

@novaugust
Copy link
Contributor

Reopening per @sebgie's comment:

I saw your discussion about urlSSL from earlier. The intention was to have a separate URL for SSL which is needed for environments like heroku. For example url: http://mydomain.com, urlSSL: https://secure.mydomain.com. Next/prev should have the correct URLs without explicitly setting urlSSL.

@novaugust novaugust reopened this Oct 13, 2014
@MaluNoPeleke
Copy link
Author

I have set the url parameter to http and the urlssl parameter to https and every other link except the prev/next links change accordingly.

@ErisDS
Copy link
Member

ErisDS commented Oct 14, 2014

It seems like this might be to do with secure not getting passed around properly. Possibly not quite as beginner as I thought.

I think @jillesme's PR was looking in the right direction but the signature for the method urlFor needs to be updated to take a secure parameter, just like the method createUrl.

I think the 3 lines that look like this: https://github.com/TryGhost/Ghost/blob/master/core/server/config/url.js#L129 also need to be updated. When using the urlFor method in the helper file the value of secure that gets set as a
res.local here should be available to pass through.

@jillesme would you be up for taking another stab at this?

@jillesme
Copy link
Contributor

Yes definitely ! 

@ErisDS ErisDS added the P2 - High [triage] High priority for immediate patch release label Oct 14, 2014
@sebgie
Copy link
Contributor

sebgie commented Oct 17, 2014

@jillesme the PR looks good to me. Unfortunately this PR has fallen a bit behind and would need a rebase. Are you around to do a quick rebase?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [triage] something behaving unexpectedly good first issue [triage] Start here if you've never contributed before. P2 - High [triage] High priority for immediate patch release
Projects
None yet
5 participants