Skip to content

Firewall and User-Agent

Sometimes login works and TLS passes, yet requests fail oddly. The cause is the User-Agent request header. Two behaviors were found in the portal flow.

Situation Result
No User-Agent sent classic.sejong.ac.kr answers 404 after SSO
A library default (for example Python-urllib) The firewall of sjpt.sejong.ac.kr blocks it and returns an “Alert!!!” HTML page

Your code is correct in both cases and only the response is strange, so it is easy to blame parsing or the login.

It sends a non-empty, non-default, identifying User-Agent on every request. The format fixed in the contract is:

pro-sejongpeia-<language>/<version>
  • Python: pro-sejongpeia-python/<version>
  • Node.js: pro-sejongpeia-node/<version>
  • Java public data calls: pro-sejongpeia-java
  • Authentication requests follow the format above.
  • Set a non-empty, distinctive User-Agent on every HTTP client.
  • Rather than imitating a browser, leave the library name and version visible. It makes finding the cause easier for both sides when something goes wrong.
  • When you get a 404 or an “Alert!!!” page, suspect the header before the parser.