Skip to content

Commit ef8633f

Browse files
author
Michael Saad
committed
Added Access-Control-Expose-Headers header to response
1 parent dd5f62c commit ef8633f

File tree

7 files changed

+273
-131
lines changed

7 files changed

+273
-131
lines changed

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ There are two methods of installation:
2424
Edit the host, go to advanced options and fill in the same hostname in **Override host**
2525
- Go to **Dictionaries** and create a new dictionary named `IntegrationConfiguration`.
2626
Add the following items in the dictionary:
27-
- customerId: Your customer ID
28-
- apiKey: The API key for your account
29-
- secret: Your KnownUserV3 secret
30-
- queueItOrigin: The name of the queue-it host, in this case it's `queue-it`
27+
- customerId: Your customer ID
28+
- apiKey: The API key for your account
29+
- secret: Your KnownUserV3 secret
30+
- queueItOrigin: The name of the queue-it host, in this case it's `queue-it`
3131
You can find these values in the Go Queue-It self-service platform.
3232
- Download the latest package file (release-package.tar.gz) from the releases page and unarchive it.
3333
- Edit the `fastly.toml` file and copy the ID of your service (you can see this by opening up the service in Fastly) and
34-
replace __{YourServiceId}__ with it.
34+
replace **{YourServiceId}** with it.
3535
- Archive the directory in the same format (tar.gz).
3636
- Go to `Package` in the Fastly service page and upload the package.
3737
- To finish up and deploy your service click on the **Activate** button.
@@ -40,17 +40,17 @@ There are two methods of installation:
4040

4141
- Go to the Fastly services page and create a new **Wasm** service and copy it's ID.
4242
- Clone this repository and edit the fastly.toml file, make sure to set the `service_id` field to the ID you copied.
43-
- Then click on *Origins* and add a new host that has the hostname of your origin server.
43+
- Then click on *Origins* and add a new host that has the hostname of your origin server.
4444
You can name the host **origin** or whatever you choose.
45-
- Create a host that has the hostname of `{yourCustomerId}.queue-it.net` and name it **queue-it**.
45+
- Create a host that has the hostname of `{yourCustomerId}.queue-it.net` and name it **queue-it**.
4646
Edit the host, go to advanced options and fill in the same hostname in **Override host**
4747
- Open up the service in Fastly and go to **Dictionaries** and create a new dictionary named `IntegrationConfiguration`
4848
.
4949
Add the following items in the dictionary:
50-
- customerId: Your customer ID
51-
- apiKey: The API key for your account
52-
- secret: Your KnownUserV3 secret
53-
- queueItOrigin: The name of the queue-it origin, in this case it's `queue-it`
50+
- customerId: Your customer ID
51+
- apiKey: The API key for your account
52+
- secret: Your KnownUserV3 secret
53+
- queueItOrigin: The name of the queue-it origin, in this case it's `queue-it`
5454
You can find these values in the Go Queue-It self-service platform.
5555
- You need to add some code that uses this connector. Here is an example:
5656

assembly/helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Utils } from "./sdk/QueueITHelpers";
22
import { hmacString } from "./sdk/helpers/crypto";
33

44
export class QueueITHelper {
5-
static readonly KUP_VERSION: string = "fastly-1.0.3";
5+
static readonly KUP_VERSION: string = "fastly-1.0.4";
66

77
static configureKnownUserHashing(): void {
88
Utils.generateSHA256Hash = hmacString;

assembly/requestResponseHandler.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ export function onQueueITRequest(
6969
url: "",
7070
});
7171
// In case of ajax call send the user to the queue by sending a custom queue-it header and redirecting user to queue from javascript
72+
response.headers.set("Access-Control-Expose-Headers", validationResult.getAjaxQueueRedirectHeaderKey());
7273
response.headers.set(
7374
validationResult.getAjaxQueueRedirectHeaderKey(),
7475
QueueITHelper.addKUPlatformVersion(

assembly/sdk/UserInQueueService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {ActionTypes, RequestValidationResult, QueueEventConfig, CancelEventConfi
33
import {StateInfo, UserInQueueStateCookieRepository} from './UserInQueueStateCookieRepository'
44

55
export class UserInQueueService {
6-
static readonly SDK_VERSION: string = "v3-asmscrpt-" + "3.6.0";
6+
static readonly SDK_VERSION: string = "v3-asmscrpt-3.6.1";
77

88
constructor(private userInQueueStateRepository: UserInQueueStateCookieRepository) {
99
}

index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
const fs = require("fs");
22
const loader = require("@assemblyscript/loader");
33
const imports = {};
4-
const wasmModule = loader.instantiateSync(fs.readFileSync(__dirname + "/build/optimized.wasm"), imports);
4+
const wasmModule = loader.instantiateSync(
5+
fs.readFileSync(__dirname + "/build/optimized.wasm"),
6+
imports
7+
);
58
module.exports = wasmModule.exports;

0 commit comments

Comments
 (0)