question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Closure Compiler Service always responds with status 302

See original GitHub issue

Hi!

I do not know if this is the right place for these kinds of questions, if it is not the place sorry in advance.

I noticed that the Closure Compiler Service is not working correctly because it always responds with a 302 status code.

I have a python script that uses the Closure Compiler Service for compile my library. I think that it is not an error in my script because even if you follow the getting started tutorial you will get the same error.

Copy pasting from the getting started tutorial:

#!/usr/bin/python2.4

import httplib, urllib, sys

params = urllib.urlencode([
    ('js_code', sys.argv[1]),
    ('compilation_level', 'WHITESPACE_ONLY'),
    ('output_format', 'text'),
    ('output_info', 'compiled_code'),
  ])
headers = { "Content-type": "application/x-www-form-urlencoded" }
conn = httplib.HTTPConnection('closure-compiler.appspot.com')
conn.request('POST', '/compile', params, headers)
response = conn.getresponse()
data = response.read()
print data
conn.close()

When we run in a terminal the following command

python compile.py 'alert("hello");// This comment should be stripped'

This command should prints out the compressed code from the Closure Compiler response, but the response is empty and the status code of the response is 302.

I am noticing this problem since 25th of October, because this day I could compile my library using the Closure Compiler Service.

Do you know if some thing change during this days?

Thank you very much!!!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
Reflex14commented, Oct 30, 2017

Yes, we have the same problem. Over 300 sites using our CMS cannot minify after they change their template in our template editor.

The solution: change http to https:

https://closure-compiler.appspot.com/compile

0reactions
biswcommented, Nov 8, 2017

Awesome. I waste around 4h and nothing get help. Its worked as charm with above solutions. Thank you very much…)

Read more comments on GitHub >

github_iconTop Results From Across the Web

while hitting an API Request throws 302 status code how to ...
302 is a status code returned by the server to indicate that the client should retry the request using a different URL.
Read more >
Closure Compiler Service API Reference - Google Developers
Stay organized with collections Save and categorize content based on your preferences. Closure compiler service is deprecated, and will be ...
Read more >
How To Fix the HTTP 302 Error (5 Methods) - Kinsta
The server response will include both the 302 status code and the Location: blogging.example.com header. This setting tells the user's browser ...
Read more >
Google Closure Compiler Shifts from Java to JavaScript
Google's Closure compiler no longer needs Java for optimizing JavaScript. The source code of Java will now be compiled into Javascript, ...
Read more >
afi24-302.pdf - Air Force
commodity or service in this publication does not imply ... Motor Vehicle Work Order Status, AF Form 1827, Minor Maintenance Work Order, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found