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

외부 리소스 로딩시 프로토콜 상대주소를 지정할 수 있도록 개선 #1290

Merged
1 commit merged into from
Mar 23, 2015
Merged

Conversation

kijin
Copy link
Contributor

@kijin kijin commented Feb 25, 2015

최근 SSL 이용이 급속도로 확산되면서 대부분의 세계적인 CDN들은 //로 시작하는 프로토콜 상대주소(protocol-relative URL) 이용을 권장하고 있습니다. 현재 페이지가 SSL을 이용할 경우 CDN도 자동으로 SSL을 이용하고, 현재 페이지가 SSL을 이용하지 않을 경우 CDN도 SSL을 이용하지 않도록 하는 방법이죠.

그러나 현재 XE 템플릿에서 사이트 외부의 리소스를 로딩하려고 하면 반드시 http:// 또는 https://로 시작하는 절대주소를 입력해야 합니다. 아래와 같이 프로토콜 상대주소를 쓰면...

<load target="//cdnjs.cloudflare.com/ajax/libs/less.js/2.4.0/less.min.js" />

당연히 안됩니다 ㅠㅠ

TemplateHandlerFrontEndFileHandler에서 프로토콜 상대주소를 인식하지 못하기 때문인데요... 이걸 우회하려면 Context::loadFile()을 직접 호출하거나, 현재 페이지의 SSL 사용 여부를 판단해서 조건문으로 처리해야 합니다. 귀찮고 지저분하죠.

그래서 귀찮고 지저분하지 않도록 고쳐봤습니다. 풀리퀘 받아주세요 ^^

@izuzero
Copy link
Contributor

izuzero commented Feb 25, 2015

<load target="///cdnjs.cloudflare.com/ajax/libs/less.js/2.4.0/less.min.js" />
이러면 되긴 하는데 편법이죠. ㅎㅎ 수고하셨어요 :)

@kijin
Copy link
Contributor Author

kijin commented Feb 25, 2015

@izuzero 부왘! 그런 편법이 있었군요. 우편번호 모듈 작성할 때 왜 그걸 모르고 삽질했을까요 ㅠ

@YJSoft
Copy link
Contributor

YJSoft commented Feb 25, 2015

#910

@kijin
Copy link
Contributor Author

kijin commented Feb 25, 2015

꽤 오래 전부터 관련 이슈가 열려 있었군요. (검색해 봤는데? github 검색 너무 불편함!)

저는 커밋이 첨부되지 않은 이슈는 열지 않습니다 ^___^

@ghost ghost added this to the 1.8.0.beta.2 milestone Mar 5, 2015
@ghost ghost self-assigned this Mar 5, 2015
@ghost ghost modified the milestones: 1.8.0.beta.2, 1.8.0-beta.3 Mar 13, 2015
@ghost ghost added the type/enhancement label Mar 18, 2015
@ghost ghost merged commit cd82366 into xpressengine:develop Mar 23, 2015
@ghost ghost added the merged-pull-request label Mar 23, 2015
@kijin kijin deleted the fix/load-remote branch March 23, 2015 08:33
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants