Skip to content

Commit

Permalink
Fix content type for app.js
Browse files Browse the repository at this point in the history
  • Loading branch information
pierotofy committed Jan 10, 2023
1 parent e45d27d commit f1f0753
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions libretranslate/app.py
Expand Up @@ -302,9 +302,9 @@ def appjs():
if args.disable_web_ui:
abort(404)

return render_template("app.js.template",
return Response(render_template("app.js.template",
url_prefix=args.url_prefix,
get_api_key_link=args.get_api_key_link)
get_api_key_link=args.get_api_key_link), content_type='application/javascript; charset=utf-8')

@bp.get("/languages")
@limiter.exempt
Expand Down
2 changes: 1 addition & 1 deletion libretranslate/templates/index.html
Expand Up @@ -97,7 +97,7 @@

var btnChangeLangs = document.getElementsByClassName("change-language");
var localePanels = document.getElementsByClassName("locale-panel");
console.log(btnChangeLangs);

for (var i = 0; i < btnChangeLangs.length; i++){
(function(btn){
btn.addEventListener('click', function(e){
Expand Down

0 comments on commit f1f0753

Please sign in to comment.