Created
July 14, 2015 14:31
-
-
Save pearofducks/0b6cfc10e7c7b00fed57 to your computer and use it in GitHub Desktop.
python simplehttpserver with custom header for apple passbook
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import SimpleHTTPServer | |
class MyHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): | |
def end_headers(self): | |
self.send_my_headers() | |
SimpleHTTPServer.SimpleHTTPRequestHandler.end_headers(self) | |
def send_my_headers(self): | |
self.send_header("Content-Type", "application/vnd.apple.pkpass") | |
if __name__ == '__main__': | |
SimpleHTTPServer.test(HandlerClass=MyHTTPRequestHandler) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment