Hmmm.. Is this when connecting to our public server, or your own? If the latter, what does your cors config look like?
sent from my phone.
--
You received this message because you are subscribed to the Google Groups "HAPI FHIR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hapi-fhir+unsubscribe@googlegroups.com.
To post to this group, send email to hapi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hapi-fhir/9a14879f-b83a-4dfc-9372-2a875337d71f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to hapi-fhir+...@googlegroups.com.
Here is the detailed request:
Request URL:http://fhirtest.uhn.ca/baseDstu2/AllergyIntolerance Request Method:POST Status Code:403 Forbidden Remote Address:199.212.7.152:80 Response Headers view source Connection:close Content-Length:0 Content-Type:text/plain; charset=UTF-8 Date:Tue, 15 Nov 2016 16:58:37 GMT Server:Apache-Coyote/1.1 Request Headers Accept:application/json+fhir, */*; q=0.01 Accept-Encoding:gzip, deflate Accept-Language:en-US Connection:keep-alive Content-Length:595 Content-Type:application/json+fhir; charset=UTF-8 Host:fhirtest.uhn.ca Origin:file:// User-Agent:Mozilla/5.0 (Linux; Android 6.0.1; SM-G935T Build/MMB29M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/54.0.2840.85 Mobile Safari/537.36 X-DevTools-Emulate-Network-Conditions-Client-Id:431ed192-3bef-4559-99e6-f1aa3996f6a8 X-Requested-With:edu.temple.fhir Request Payload {"resourceType":"AllergyIntolerance","onset":"2016-11-11","type":"allergy","category":"food","reaction":{"manifestation":{"coding":{"system":"http://fhirtest.uhn.ca/baseDstu2","code":"abdominal pain and/or pain","display":"abdominal pain and/or pain"},"text":"abdominal pain and/or pain"}},"extension":[{"url":"http://fhirtest.uhn.ca/baseDstu2","valueCoding":{"system":"http://fhirtest.uhn.ca/baseDstu2","code":"Name","display":"Test Allergy"}},{"url":"http://fhirtest.uhn.ca/baseDstu2","valueCoding":{"system":"http://fhirtest.uhn.ca/baseDstu2","code":"Treatment","display":"Test Treatment"}}]}
To unsubscribe from this group and stop receiving emails from it, send an email to hapi-fhir+unsubscribe@googlegroups.com.
To post to this group, send email to hapi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hapi-fhir/86506e06-c7ad-41c7-9da1-b5fdd8dba763%40googlegroups.com.
| /** | |
| * Checks if a given origin is valid or not. Criteria: | |
| * <ul> | |
| * <li>If an encoded character is present in origin, it's not valid.</li> | |
| * <li>Origin should be a valid {@link URI}</li> | |
| * </ul> | |
| * | |
| * @param origin | |
| * @see <a href="http://tools.ietf.org/html/rfc952">RFC952</a> | |
| * @return | |
| */ | |
| public static boolean isValidOrigin(String origin) { | |
| // Checks for encoded characters. Helps prevent CRLF injection. | |
| if (origin.contains("%")) { | |
| return false; | |
| } | |
| URI originURI; | |
| try { | |
| originURI = new URI(origin); | |
| } catch (URISyntaxException e) { | |
| return false; | |
| } | |
| // If scheme for URI is null, return false. Return true otherwise. | |
| return originURI.getScheme() != null; | |
| } |
To unsubscribe from this group and stop receiving emails from it, send an email to hapi-fhir+unsubscribe@googlegroups.com.
To post to this group, send email to hapi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hapi-fhir/3e75f175-b742-4d11-922f-c89fb1aaae1b%40googlegroups.com.
/**
* Checks if a given origin is valid or not. Criteria:
* <ul>
* <li>If an encoded character is present in origin, it's not valid.</li>
* <li>If origin is "null", it's valid.</li>
* <li>Origin should be a valid {@link URI}</li>
* </ul>
*
* @param origin
* @see <a href="http://tools.ietf.org/html/rfc952">RFC952</a>
*/
protected static boolean isValidOrigin(String origin) {
// Checks for encoded characters. Helps prevent CRLF injection.
if (origin.contains("%")) {
return false;
}
// "null" is a valid origin
if ("null".equals(origin)) {
return true;
}
// RFC6454, section 4. "If uri-scheme is file, the implementation MAY
// return an implementation-defined value.". No limits are placed on
// that value so treat all file URIs as valid origins.
if (origin.startsWith("file://")) {
return true;
}
URI originURI;
try {
originURI = new URI(origin);
} catch (URISyntaxException e) {
return false;
}
// If scheme for URI is null, return false. Return true otherwise.
return originURI.getScheme() != null;
}To unsubscribe from this group and stop receiving emails from it, send an email to hapi-fhir+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hapi-fhir/f46dc5e5-670f-4e8b-b91f-ff15c9f94eea%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to hapi-fhir+unsubscribe@googlegroups.com.
To post to this group, send email to hapi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hapi-fhir/096a78d1-028c-48a1-8674-59a9da2e3f7e%40googlegroups.com.