외부 리소스 로딩시 프로토콜 상대주소를 지정할 수 있도록 개선 #1290
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
최근 SSL 이용이 급속도로 확산되면서 대부분의 세계적인 CDN들은
//
로 시작하는 프로토콜 상대주소(protocol-relative URL) 이용을 권장하고 있습니다. 현재 페이지가 SSL을 이용할 경우 CDN도 자동으로 SSL을 이용하고, 현재 페이지가 SSL을 이용하지 않을 경우 CDN도 SSL을 이용하지 않도록 하는 방법이죠.그러나 현재 XE 템플릿에서 사이트 외부의 리소스를 로딩하려고 하면 반드시
http://
또는https://
로 시작하는 절대주소를 입력해야 합니다. 아래와 같이 프로토콜 상대주소를 쓰면...당연히 안됩니다 ㅠㅠ
TemplateHandler
와FrontEndFileHandler
에서 프로토콜 상대주소를 인식하지 못하기 때문인데요... 이걸 우회하려면Context::loadFile()
을 직접 호출하거나, 현재 페이지의 SSL 사용 여부를 판단해서 조건문으로 처리해야 합니다. 귀찮고 지저분하죠.그래서 귀찮고 지저분하지 않도록 고쳐봤습니다. 풀리퀘 받아주세요 ^^