Browse Source

Formatting of HTML/JS, upgrading jetty, fixing cookie handling, adding details to session output, added license file handling, and more.

Matt Clark 1 year ago
parent
commit
4c6a915187

+ 1 - 1
pom.xml

@@ -56,7 +56,7 @@
 		<dependency>
 			<groupId>org.eclipse.jetty</groupId>
 			<artifactId>jetty-server</artifactId>
-			<version>9.4.17.v20190418</version>
+			<version>9.4.30.v20200611</version>
 		</dependency>
 
 		<dependency>

+ 106 - 86
resources/bulk.html

@@ -1,121 +1,141 @@
 <html>
 <head>
-	<title>BarcodeAPI.org Bulk Barcode Generator</title>
+<title>BarcodeAPI.org Bulk Barcode Generator</title>
 
-	<meta name="viewport" content="width=device-width, initial-scale=1.0">
+<meta name="viewport" content="width=device-width, initial-scale=1.0">
 
-	<meta name="keywords"
-		  content="barcode, barcode app, bulk barcode generator, barcode generator, barcode api, qr code, qr code generator, code 128, code128, ean8, eac-8, ean13, ean-13, codabar, download barcode, barcodes, pdf, pdf 417">
-	<meta name="description"
-		  content="Generate barcodes of nearly any type, scan it in the web browser, or download the generated images for free.">
+<meta name="keywords"
+	content="barcode, barcode app, bulk barcode generator, barcode generator, barcode api, qr code, qr code generator, code 128, code128, ean8, eac-8, ean13, ean-13, codabar, download barcode, barcodes, pdf, pdf 417">
+<meta name="description"
+	content="Generate barcodes of nearly any type, scan it in the web browser, or download the generated images for free.">
 
-	<link rel="icon" type="image/png" href="/static/favicon.png" />
+<link rel="icon" type="image/png" href="/static/favicon.png" />
 
-	<script src="/static/index.js"></script>
+<script src="/static/index.js"></script>
 
-	<link rel="stylesheet" type="text/css"
-		  href="/static/flexboxgrid.min.css" />
-	<link rel="stylesheet" type="text/css" href="/static/index.css" />
+<link rel="stylesheet" type="text/css"
+	href="/static/flexboxgrid.min.css" />
+<link rel="stylesheet" type="text/css" href="/static/index.css" />
 </head>
 
 <body onload="loadHash(); init();">
-<div class="wrap container-fluid">
+	<div class="wrap container-fluid">
 
-	<div class="header row middle-xs between-xs">
-		<div class="col-xs-12 col-sm-3">
-			<div class="logo">
-				<a href="/"><img src="/img/barcodeapi-logo.svg" alt="BarcodeAPI Logo"
-					 aria-label="Logo"></a>
-			</div>
-		</div>
-		<div class="header-share">
-			<div class="row end-xs middle-xs">
-				<div class="col-xs">
-					<h4>
-						GOT FEEDBACK?
-						<br />
-						<span class="feedback">feedback@barcodeapi.org</span>
-					</h4>
+		<div class="header row middle-xs between-xs">
+			<div class="col-xs-12 col-sm-3">
+				<div class="logo">
+					<a href="/">
+						<img src="/img/barcodeapi-logo.svg" alt="BarcodeAPI Logo"
+							aria-label="Logo">
+					</a>
 				</div>
-				<div class="share-icon email">
-					<a
+			</div>
+			<div class="header-share">
+				<div class="row end-xs middle-xs">
+					<div class="col-xs">
+						<h4>
+							GOT FEEDBACK?
+							<br />
+							<span class="feedback">feedback@barcodeapi.org</span>
+						</h4>
+					</div>
+					<div class="share-icon email">
+						<a
 							href="mailto:feedback@barcodeapi.org?body=I%20love%20the%20new%20UI%21&amp;subject=Feedback%20about%20BarcodeAPI"
 							target="_blank">
-						<img src="/img/email.svg" alt="Share via Email"
-							 aria-label="Share Icon">
-					</a>
+							<img src="/img/email.svg" alt="Share via Email"
+								aria-label="Share Icon">
+						</a>
+					</div>
 				</div>
 			</div>
 		</div>
-	</div>
 
-	<div class="row center-xs middle-xs">
-		<div class="display-barcode col-xs-12 bulk-barcodes">
-			<div id="frame">
-				<div class="row center-xs middle-xs">
-					<div class="col-xs-12">
-						<h2><img src="/img/barcode.svg" height="20" class="icon-first"/>Bulk Barcode Generator</h2>
-						<p>Document containing barcode details should be in CSV format. Column 1 is the text of the barcode, optional Column 2 is the barcode type (see below for example). Extra fields are optional. For more information <a href="https://git.mclarkdev.com/BarcodeAPI.org/server/src/master/README.md" target="_blank">click here</a>.</p>
-						<div class="text-file-table">
-							<div class="row center-xs middle-xs heading-text">
-								<div class="col-xs-6 default">Text</div>
-								<div class="col-xs-6 default">Type*</div>
-								<div class="col-xs-3 optional">Size*</div>
-								<div class="col-xs-3 optional">DPI*</div>
-							</div>
-							<div class="row center-xs middle-xs attribute">
-								<div class="col-xs-6 default">01234567890</div>
-								<div class="col-xs-6 default">UPC-A</div>
-								<div class="col-xs-3 optional">1</div>
-								<div class="col-xs-3 optional">300</div>
-							</div>
-						</div>
-						<p class="small">* Optional column</p>
-					</div>
-					<div class="col-xs-12 bulk-upload-form">
-						<form method="post" action="bulk/" enctype="multipart/form-data">
-							<div class="row center-xs middle-xs">
-								<div class="col-xs-6">
-									<input type="file" name="csvFile" class="file-input" onclick="checkIfFileSelected()" id="csvFile"> <!--Choose File</input>-->
-									<label for="csvFile" />Choose a file</label>
+		<div class="row center-xs middle-xs">
+			<div class="display-barcode col-xs-12 bulk-barcodes">
+				<div id="frame">
+					<div class="row center-xs middle-xs">
+						<div class="col-xs-12">
+							<h2>
+								<img src="/img/barcode.svg" height="20" class="icon-first" />Bulk
+								Barcode Generator
+							</h2>
+							<p>
+								Upload your barcodes in CSV format to generate up to 250
+								barcodes at a time. Column 1 should contain the scannable
+								barcode content. All other columns are optional parameters to
+								adjust each image.
+								<br />
+								<br />
+								<span>For more information <a
+										href="https://git.mclarkdev.com/BarcodeAPI.org/server/src/master/README.md"
+										target="_blank">click here</a>.
+								</span>
+							</p>
+							<div class="text-file-table">
+								<div class="row center-xs middle-xs heading-text">
+									<div class="col-xs-6 default">Text</div>
+									<div class="col-xs-6 default">Type*</div>
+									<div class="col-xs-3 optional">Size*</div>
+									<div class="col-xs-3 optional">DPI*</div>
 								</div>
-								<div class="col-xs-6">
-									<button class="button-green" type="submit" id="generate-bc" disabled>Generate Barcodes</button>
+								<div class="row center-xs middle-xs attribute">
+									<div class="col-xs-6 default">01234567890</div>
+									<div class="col-xs-6 default">UPC-A</div>
+									<div class="col-xs-3 optional">1</div>
+									<div class="col-xs-3 optional">300</div>
 								</div>
 							</div>
-						</form>
+							<p class="small" id="optional_column_text">* Optional column</p>
+						</div>
+						<div class="col-xs-12 bulk-upload-form">
+							<form method="post" action="bulk/" enctype="multipart/form-data">
+								<div class="row center-xs middle-xs">
+									<div class="col-xs-6">
+										<input type="file" name="csvFile" class="file-input"
+											onclick="checkIfFileSelected()" id="csvFile"> <label
+											for="csvFile">Choose a file</label>
+									</div>
+									<div class="col-xs-6">
+										<button class="button-green" type="submit" id="generate-bc"
+											disabled>Generate Barcodes</button>
+									</div>
+								</div>
+							</form>
+						</div>
 					</div>
 				</div>
 			</div>
 		</div>
-	</div>
-
 
-	<!-- footer -->
-	<div class="footer row middle-xs top-sm between-xs">
-		<div class="col-xs-12 col-sm-8">
-			<h5>
-				Free, Open Source,
-				<a href="https://git.mclarkdev.com/BarcodeAPI.org/server"
-				   target="_blank">BarcodeAPI.org</a>
-			</h5>
-			<p>Generate barcodes of nearly any type, scan it in the web
-				browser, or download the generated images for free. BarcodeAPI.org
-				is an open source barcode server capable of generating a wide range
-				of barcodes over a RESTful HTTP server. <a href="/licenses.html">licenses</a></p>
-		</div>
-		<div class="col-xs-12 col-sm-4">
-			<div class="docs-link row start-xs end-sm">
-				<a
+		<!-- footer -->
+		<div class="footer row middle-xs top-sm between-xs">
+			<div class="col-xs-12 col-sm-8">
+				<h5>
+					Free, Open Source,
+					<a href="https://git.mclarkdev.com/BarcodeAPI.org/server"
+						target="_blank">BarcodeAPI.org</a>
+				</h5>
+				<p>
+					Generate barcodes of nearly any type, scan it in the web browser,
+					or download the generated images for free. BarcodeAPI.org is an
+					open source barcode server capable of generating a wide range of
+					barcodes over a RESTful HTTP server.
+					<a href="/licenses.html">licenses</a>
+				</p>
+			</div>
+			<div class="col-xs-12 col-sm-4">
+				<div class="docs-link row start-xs end-sm">
+					<a
 						href="https://git.mclarkdev.com/BarcodeAPI.org/server/src/master/README.md"
 						target="_blank" class="col-xs">
-					<span class="docs-icon"><img src="/img/docs.svg"></span> <span>Read
+						<span class="docs-icon"><img src="/img/docs.svg"></span> <span>Read
 							the API Docs</span>
-				</a>
+					</a>
+				</div>
 			</div>
 		</div>
 	</div>
-</div>
 </body>
 </html>
 

+ 73 - 0
resources/licenses.html

@@ -0,0 +1,73 @@
+<html>
+<head>
+<title>BarcodeAPI.org Bulk Barcode Generator</title>
+
+<meta name="viewport" content="width=device-width, initial-scale=1.0">
+
+<meta name="keywords"
+	content="barcode, barcode app, bulk barcode generator, barcode generator, barcode api, qr code, qr code generator, code 128, code128, ean8, eac-8, ean13, ean-13, codabar, download barcode, barcodes, pdf, pdf 417">
+<meta name="description"
+	content="Generate barcodes of nearly any type, scan it in the web browser, or download the generated images for free.">
+
+<link rel="icon" type="image/png" href="/static/favicon.png" />
+
+<script src="/static/index.js"></script>
+<script src="/static/licenses.js"></script>
+
+<link rel="stylesheet" type="text/css"
+	href="/static/flexboxgrid.min.css" />
+<link rel="stylesheet" type="text/css" href="/static/index.css" />
+</head>
+
+<body onload="loadLicenses();">
+	<div class="wrap container-fluid">
+
+		<div class="header row middle-xs between-xs">
+			<div class="col-xs-12 col-sm-3">
+				<div class="logo">
+					<a href="/">
+						<img src="/img/barcodeapi-logo.svg" alt="BarcodeAPI Logo"
+							aria-label="Logo">
+					</a>
+				</div>
+			</div>
+			<div class="header-share">
+				<div class="row end-xs middle-xs">
+					<div class="col-xs">
+						<h4>
+							GOT FEEDBACK?
+							<br />
+							<span class="feedback">feedback@barcodeapi.org</span>
+						</h4>
+					</div>
+					<div class="share-icon email">
+						<a
+							href="mailto:feedback@barcodeapi.org?body=I%20love%20the%20new%20UI%21&amp;subject=Feedback%20about%20BarcodeAPI"
+							target="_blank">
+							<img src="/img/email.svg" alt="Share via Email"
+								aria-label="Share Icon">
+						</a>
+					</div>
+				</div>
+			</div>
+		</div>
+
+		<div class="row center-xs middle-xs">
+			<div class="display-barcode col-xs-12 bulk-barcodes">
+				<div id="frame">
+					<div class="row center-xs middle-xs">
+						<div class="col-xs-12">
+							<h2>
+								<img src="/img/barcode.svg" height="20" class="icon-first" />BarcodeAPI.org
+								Licenses
+							</h2>
+						</div>
+						<pre id="licenses"></pre>
+					</div>
+				</div>
+			</div>
+		</div>
+	</div>
+</body>
+</html>
+

+ 139 - 109
resources/static/index.css

@@ -1,9 +1,10 @@
 @font-face {
-  font-family: 'IBM Plex Mono';
-  font-style: normal;
-  font-weight: 400;
-  font-display: swap;
-  src: local('IBM Plex Mono'), local('IBMPlexMono'), url(/static/IBM-Plex-Mono.ttf) format('truetype');
+	font-family: 'IBM Plex Mono';
+	font-style: normal;
+	font-weight: 400;
+	font-display: swap;
+	src: local('IBM Plex Mono'), local('IBMPlexMono'),
+		url(/static/IBM-Plex-Mono.ttf) format('truetype');
 }
 
 body {
@@ -44,7 +45,7 @@ h5 a {
 }
 
 h3, h4 {
-    text-transform: uppercase;
+	text-transform: uppercase;
 }
 
 .share-icon, .barcode-icon {
@@ -159,7 +160,7 @@ h3, h4 {
 }
 
 .barcode-text-input-clear, .button, .button-green {
-    font-family: 'IBM Plex Mono';
+	font-family: 'IBM Plex Mono';
 	width: 100%;
 	border-radius: 1.5rem;
 	background: #222;
@@ -184,65 +185,62 @@ h3, h4 {
 	background: #27a46a;
 }
 
-button:disabled,
-button[disabled] {
-    background: #999;
-    pointer-events: none;
+button:disabled, button[disabled] {
+	background: #999;
+	pointer-events: none;
 }
 
-
 [type="file"] {
-  border: 0;
-  clip: rect(0, 0, 0, 0);
-  height: 1px;
-  overflow: hidden;
-  padding: 0;
-  position: absolute !important;
-  white-space: nowrap;
-  width: 1px;
-}
-
-[type="file"] + label {
-  cursor: pointer;
-  display: inline-block;
-  font-family: 'IBM Plex Mono';
-  outline: none;
-  color: #FFF;
-  width: 100%;
-  background: #222;
-  padding: 1rem;
-  border-radius: 1.5rem;
-  text-align: center;
-  background: #222;
-  font-size: 13px;
-  color: #FFF;
-  font-weight: 600;
-  box-sizing: border-box;
-  transition: background-color 0.2s ease-in-out;
-  margin-bottom: 1rem;
-}
-
-[type="file"]:focus + label,
-[type="file"] + label:hover {
-    background: #2e7bca;
-}
-
-[type="file"]:focus + label {
-  outline: 1px dotted #2e7bca;
+	border: 0;
+	clip: rect(0, 0, 0, 0);
+	height: 1px;
+	overflow: hidden;
+	padding: 0;
+	position: absolute !important;
+	white-space: nowrap;
+	width: 1px;
+}
+
+[type="file"]+label {
+	cursor: pointer;
+	display: inline-block;
+	font-family: 'IBM Plex Mono';
+	outline: none;
+	color: #FFF;
+	width: 100%;
+	background: #222;
+	padding: 1rem;
+	border-radius: 1.5rem;
+	text-align: center;
+	background: #222;
+	font-size: 13px;
+	color: #FFF;
+	font-weight: 600;
+	box-sizing: border-box;
+	transition: background-color 0.2s ease-in-out;
+	margin-bottom: 1rem;
+}
+
+[type="file"]:focus+label, [type="file"]+label:hover {
+	background: #2e7bca;
+}
+
+[type="file"]:focus+label {
+	outline: 1px dotted #2e7bca;
 }
 
 .bulk-barcodes p {
-    margin-bottom: 1rem;
+	margin-bottom: 1rem;
 }
 
 .bulk-barcodes p.small {
-    font-size: 11px;
+	font-size: 11px;
 }
 
 .bulk-barcodes h2 img {
-    position: relative;
-    top: 3px;
-    padding-right: 10px;
+	position: relative;
+	top: 3px;
+	padding-right: 10px;
 }
 
 .barcode-text-input-clear:hover {
@@ -269,54 +267,55 @@ button[disabled] {
 	padding-right: 10px;
 	position: relative;
 }
+
 .docs-icon img {
 	position: relative;
-	top:3px;
+	top: 3px;
 }
 
 .bulk-upload {
-    margin-top: 2rem;
-    margin-bottom: 2rem;
+	margin-top: 2rem;
+	margin-bottom: 2rem;
 }
 
 .bulk-barcodes {
-    max-width: 640px;
-    margin-bottom: 4rem;
+	max-width: 640px;
+	margin-bottom: 4rem;
 }
 
 .bulk-barcodes p {
-    text-align: left;
-    margin-bottom: 2rem;
+	text-align: left;
+	margin-bottom: 2rem;
 }
 
 .text-link {
-    font-size: 14px;
+	font-size: 14px;
 }
 
 .text-link:hover img.icon-last {
-    padding-left: 8px;
+	padding-left: 8px;
 }
 
 .text-link img.icon-last {
-    padding-left: 4px;
-    width: 12px;
-    height: 12px;
-    position: relative;
-    top: 2px;
-    transition: all 0.2s ease-in-out;
+	padding-left: 4px;
+	width: 12px;
+	height: 12px;
+	position: relative;
+	top: 2px;
+	transition: all 0.2s ease-in-out;
 }
 
 .text-link img.icon-first {
-    padding-left: 0;
-    padding-right: 6px;
-    height: 14px;
-    width: 14px;
-    top: 3px;
-    position: relative;
+	padding-left: 0;
+	padding-right: 6px;
+	height: 14px;
+	width: 14px;
+	top: 3px;
+	position: relative;
 }
 
 .select-type {
-	position:relative;
+	position: relative;
 	text-transform: uppercase;
 	font-weight: 600;
 	display: none;
@@ -347,6 +346,7 @@ button[disabled] {
 	-o-transform: rotate(180deg);
 	transform: rotate(180deg);
 }
+
 .select-type a {
 	width: 100%;
 	display: block;
@@ -361,25 +361,25 @@ button[disabled] {
 }
 
 .text-file-table {
-    margin-top: 1rem;
-    margin-bottom: 0.5rem;
+	margin-top: 1rem;
+	margin-bottom: 0.5rem;
 }
 
 .text-file-table .heading-text div {
-    padding: 0.25rem;
-    color: #222;
-    background: #EEE;
-    text-align: center;
-    font-size: 12px;
-    font-weight: 600;
+	padding: 0.25rem;
+	color: #222;
+	background: #EEE;
+	text-align: center;
+	font-size: 12px;
+	font-weight: 600;
 }
 
 .text-file-table .attribute div {
-    padding: 0.25rem;
-    background: #FFF;
-    color: #222;
-    text-align: center;
-    font-size: 12px;
+	padding: 0.25rem;
+	background: #FFF;
+	color: #222;
+	text-align: center;
+	font-size: 12px;
 }
 
 @media only screen and (max-width: 600px) {
@@ -400,17 +400,17 @@ button[disabled] {
 	.choose-barcode-type {
 		margin-bottom: 1rem;
 	}
-	.text-file-table .attribute div.optional,
-    .text-file-table .heading-text div.optional {
-        display: none;
-    }
+	.text-file-table .attribute div.optional, .text-file-table .heading-text div.optional
+		{
+		display: none;
+	}
 }
 
 @media only screen and (max-width: 450px) {
-    .bulk-upload-form .col-xs-6 {
-        flex-basis: 100%;
-        max-width: 90%;
-    }
+	.bulk-upload-form .col-xs-6 {
+		flex-basis: 100%;
+		max-width: 90%;
+	}
 }
 
 /* between sm and xs */
@@ -420,11 +420,11 @@ button[disabled] {
 		margin: 0;
 		padding: 1rem 0;
 	}
-    .text-file-table .attribute div.default,
-    .text-file-table .heading-text div.default {
-        flex-basis: 25%;
-        max-width: 25%;
-    }
+	.text-file-table .attribute div.default, .text-file-table .heading-text div.default
+		{
+		flex-basis: 25%;
+		max-width: 25%;
+	}
 }
 
 /* equal to sm breakpoint */
@@ -448,17 +448,40 @@ button[disabled] {
 	position: relative;
 }
 
-@keyframes fadeOut {
-	from {opacity: 1;}
-	to {opacity: 0;}
+@
+keyframes fadeOut {
+	from {opacity: 1;
 }
 
-@keyframes pulseBg {
-	0% { border-color: #222; }
-	50% { border-color: #EEE; }
-	100% { border-color: #222; }
+to {
+	opacity: 0;
 }
 
+}
+@
+keyframes pulseBg { 0% {
+	border-color: #222;
+}
+
+50%
+{
+border-color
+:
+ 
+#EEE
+;
+ 
+}
+100%
+{
+border-color
+:
+ 
+#222
+;
+ 
+}
+}
 #message {
 	display: none;
 	padding: 10px;
@@ -546,3 +569,10 @@ button[disabled] {
 	height: 24px;
 }
 
+#optional_column_text {
+	float: right;
+}
+
+#licenses {
+	text-align: left;
+}

+ 24 - 24
resources/static/index.js

@@ -1,3 +1,5 @@
+const sUsrAg = navigator.userAgent;
+
 /**
  * Call our method when the URL hash changes.
  */
@@ -5,27 +7,7 @@ window.onhashchange = loadHash;
 
 /**
  * Called each time we should read the hash of the URL.
- * 
- * @returns
  */
-const sUsrAg = navigator.userAgent;
-
-function checkIfFileSelected() {
-
-    var submitButton = document.getElementById("generate-bc");
-
-    document.getElementById('csvFile').addEventListener('change', function () {
-    if(this.value.length > 0) {
-        console.log("file selected");
-        submitButton.removeAttribute("disabled");
-       } else {
-            console.log("no file");
-            submitButton.addAttribute("disabled");
-        }
-     });
-}
-
-
 function loadHash() {
 
 	// Get current hash ( minus # )
@@ -181,6 +163,7 @@ async function copyImageToClipboard() {
 
 var types = getTypes();
 function getTypes() {
+
 	const url = location.origin + "/types/";
 	const t = fetch(url).then((response) => {
 		return response.json();
@@ -205,6 +188,7 @@ function getCode(code) {
 }
 
 function showCodeDescription(code) {
+
 	 console.log(getCode(code))
 }
 
@@ -212,7 +196,7 @@ async function setPattern(hash) {
 
 	const code = getCode(hash);
 	const textInput = document.getElementById("text");
-	
+
 	if(code !== null) {
 		textInput.setAttribute("pattern", code.pattern);
 	} else {
@@ -221,8 +205,9 @@ async function setPattern(hash) {
 }
 
 async function init() {
+
 	types = await getTypes();
-	 hash = location.hash.substring(1);
+	hash = location.hash.substring(1);
 	await setPattern(hash);
 
 	// hide copy image button in FF
@@ -233,8 +218,23 @@ async function init() {
 }
 
 function setType(type) {
-	
-	location.hash   =type;
+
+	location.hash =type;
 	closeMenu();
 	setPattern(type);
 }
+
+function checkIfFileSelected() {
+
+	var submitButton = document.getElementById("generate-bc");
+
+	document.getElementById('csvFile').addEventListener('change', function () {
+		if(this.value.length > 0) {
+			console.log("file selected");
+			submitButton.removeAttribute("disabled");
+		} else {
+			console.log("no file");
+			submitButton.addAttribute("disabled");
+		}
+	});
+}

+ 13 - 0
resources/static/license.txt

@@ -0,0 +1,13 @@
+Copyright 2020 BarcodeAPI.org
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.

+ 23 - 0
resources/static/licenses.js

@@ -0,0 +1,23 @@
+function loadLicenses() {
+
+	var url = "/static/license.txt";
+	loadFile(url, onloadLicenses);
+}
+
+function onloadLicenses(data) {
+
+	document.getElementById("licenses").innerHTML = data;
+}
+
+function loadFile(path, callback) {
+
+	var xobj = new XMLHttpRequest();
+	xobj.overrideMimeType("application/json");
+	xobj.open('GET', path, true);
+	xobj.onreadystatechange = function() {
+		if (xobj.readyState == 4 && xobj.status == "200") {
+			callback(xobj.responseText);
+		}
+	};
+	xobj.send(null);
+}

+ 3 - 3
src/main/java/org/barcodeapi/server/api/BulkHandler.java

@@ -26,14 +26,14 @@ public class BulkHandler extends RestHandler {
 		super.handle(target, baseRequest, request, response);
 
 		// Setup accept multi-part
-		request.setAttribute(Request.__MULTIPART_CONFIG_ELEMENT, MULTI_PART_CONFIG);
+		request.setAttribute(Request.MULTIPART_CONFIG_ELEMENT, MULTI_PART_CONFIG);
 		if (!request.getContentType().startsWith("multipart/")) {
 			return;
 		}
 
 		// Response headers for file download
 		response.setHeader("Content-Type", "application/zip");
-		response.setHeader("Content-Disposition", "filename=bulk.zip");
+		response.setHeader("Content-Disposition", "filename=barcodes.zip");
 
 		try {
 
@@ -41,7 +41,7 @@ public class BulkHandler extends RestHandler {
 			Part part = request.getPart("csvFile");
 
 			// Pass input and output streams to bulk helper
-			BulkUtils.getZippedBarcodes(100, //
+			BulkUtils.getZippedBarcodes(250, //
 					part.getInputStream(), response.getOutputStream());
 
 		} catch (GenerationException e) {

+ 1 - 1
src/main/java/org/barcodeapi/server/core/RestHandler.java

@@ -97,7 +97,7 @@ public class RestHandler extends AbstractHandler {
 		// user session info
 		CachedSession session = getSession(request);
 		session.hit(baseRequest.getOriginalURI().toString());
-		response.addHeader("Set-Cookie", "session=" + session.getKey() + ";");
+		response.addCookie(session.getCookie());
 	}
 
 	protected void addCORS(HttpServletRequest request, HttpServletResponse response) {

+ 17 - 2
src/main/java/org/barcodeapi/server/session/CachedSession.java

@@ -4,17 +4,21 @@ import java.util.UUID;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.TimeUnit;
 
+import javax.servlet.http.Cookie;
+
 import org.barcodeapi.server.core.CachedObject;
 
 public class CachedSession extends CachedObject {
 
 	private final String key;
+	private final long timeCreated;
 	private final ConcurrentHashMap<String, Integer> sessionRequests;
 
 	public CachedSession() {
 		this.setTimeout(6, TimeUnit.HOURS);
 
 		this.key = UUID.randomUUID().toString();
+		this.timeCreated = System.currentTimeMillis();
 		this.sessionRequests = new ConcurrentHashMap<String, Integer>();
 	}
 
@@ -38,12 +42,23 @@ public class CachedSession extends CachedObject {
 	public String getDetails() {
 
 		String details = "" + //
-				"Key: " + getKey() + "\n\n";
+				"Key: " + getKey() + "\n" + //
+				"Created: " + timeCreated + "\n" + //
+				"Requests: " + sessionRequests.size() + "\n";
+
 		for (String key : sessionRequests.keySet()) {
 
-			details += String.format("%s:%s\n", key, sessionRequests.get(key));
+			details += String.format("%s :: %s\n", sessionRequests.get(key), key);
 		}
 
 		return details;
 	}
+
+	public Cookie getCookie() {
+
+		Cookie cookie = new Cookie("session", getKey());
+		cookie.setSecure(true);
+
+		return cookie;
+	}
 }