Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

fix($templateRequest): Set Accept header on template requests #11868

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/ng/templateRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ function $TemplateRequestProvider() {

var httpOptions = {
cache: $templateCache,
transformResponse: transformResponse
transformResponse: transformResponse,
headers: { 'Accept': 'text/html, text/ng-template' }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a feeling it would be safest to move this to the provider so that it could always be modified on an app by app basis.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. The proposal here sounds like a good default value.

BTW, this needs tests.

};

return $http.get(tpl, httpOptions)
Expand Down