Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8514097
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T04:46:05+00:00 2026-06-11T04:46:05+00:00

I have developed a CORS REST server and some pages with some JS code

  • 0

I have developed a CORS REST server and some pages with some JS code that invoke its urls.

I decided to refactor the JS pages, and my DELETE ajax request to server now doesn’t work anymore. Part of the refactor involves the URL that pass from http://localhost/dev to http://dev.local. I added the new url in the allowed origin for requests, in fact my GET routes still work without problems.

DELETE instead is not allowed now (403 on the preflight) and i don’t understand where my mistake is.

Here the OPTIONS and DELETE dumps from dev perspective:

Request URL:http://localhost:9292/users/101
Request Method:OPTIONS
Status Code:200 OK
Request Headers
Accept:*/*
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Access-Control-Request-Headers:origin, accept
Access-Control-Request-Method:DELETE
Cache-Control:no-cache
Connection:keep-alive
Host:localhost:9292
Origin:http://dev.local
Pragma:no-cache
Referer:http://dev.local/
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.89 Safari/537.1
Response Headers
Access-Control-Allow-Credentials:true
Access-Control-Allow-Headers:origin, accept
Access-Control-Allow-Methods:PUT, OPTIONS, DELETE, GET, POST
Access-Control-Allow-Origin:http://dev.local
Access-Control-Expose-Headers:Content-Type
Access-Control-Max-Age:1728000
Connection:close
Content-Type:text/plain
Server:thin 1.3.1 codename Triple Espresso

responds with a payload that contains “Forbidden”. Here the DELETE req:

Request URL:http://localhost:9292/users/101
Request Method:DELETE
Status Code:403 Forbidden
Request Headers
DELETE /users/101 HTTP/1.1
Host: localhost:9292
Connection: keep-alive
Cache-Control: no-cache
Origin: http://dev.local
Pragma: no-cache
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.89 Safari/537.1
Accept: application/json, text/javascript, */*; q=0.01
Referer: http://dev.local/
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: fbsr_348362375211512=r2WOBYNXrmyP6lKJ7JVAnlU9gfLjela8jRSarGHvQ-M.eyJhbGdvcml0aG0iOiJITUFDLVNIQTI1NiIsImNvZGUiOiJBUURSRDhOckJ2YnI0MlFLTk5vblhiOGNVcjVXTFpHTDNMcVBjYl9PXzFqd3hKS0tlWFZ1cFVVMi03OXNxOU1BcjFGV2RxTzVtV0RSTllXbkxKcndUQmtZOFpMS3VmeWt0b05xU3ctVzdqNk4zVHBFQVZOM3ZlRzFKeW5lRWpiRkxSdXlPNHpGMDNVd255RFZqZ0xOdHQwMTJCUWVvb0NSR1ZSTVUtQkVhS1ZtaGtKZGdKck5RSDUwWHhQVW5wT1MyY0EiLCJpc3N1ZWRfYXQiOjEzNDY0MjUyMzgsInV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kiB2lkBjsA%0ARmlqSSIObG9nZ2VkX2luBjsARlRJIgljc3JmBjsARiJFNWRjMjdjZThkNTM0%0ANWFhMTU3OGQ2ZDk3NGJjYjZjZGMzMzEwOTFiNTg5OTk1YTMyYTYxOTMzMTgy%0AMTU0N2E2ZA%3D%3D%0A--578809491df1629d183c98a530ccbcf925000b6e; path=/; HttpOnly
Access-Control-Allow-Origin: http://dev.local
Access-Control-Allow-Methods: PUT, OPTIONS, DELETE, GET, POST
Access-Control-Expose-Headers: Content-Type
Access-Control-Max-Age: 1728000
Access-Control-Allow-Credentials: true
Vary: Origin
Connection: close
Server: thin 1.3.1 codename Triple Espresso

Any idea or suggestion to determine the problem?

Thanks, Dario.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T04:46:06+00:00Added an answer on June 11, 2026 at 4:46 am

    After a search and the advices by monsur (he helps me to realize that client side all is correct), I raised the rack log level to debug level and I’ve found an “attack
    prevented by Rack::Protection::RemoteToken”
    notifing that the problem is a misconfiguration of rack-protectionused by Sinatra.

    By default, since the referrer is different, my app stumble in CSRF protection; disabling:

    set :protection, :except => [:remote_token, :frame_options]
    

    It works.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have developed a web site that requires user registration and authentication for some
I have developed a Java server using Eclipse that accepts TCP socket connection from
Have developed a small Windows application using SQL Server as its database. I need
I have developed a sample WCF REST service that accepts that creates an Order
I have developed a servlet that outputs the server.log file of my JBoss 7.1
I have developed sample api as jar file. This jar file contains the code
I have developed an app that in testing has worked fine but when it
I have developed a behavior that changes the Clip property of the AssociatedObject. When
I have developed a web application that uses the jQuery DateTimePicker by Trent Richardson
I have developed a grails application that stores a great deal of information. Currently,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.